SOLVED: "Cannot start service db: error creating zfs mount:" after zfs snapshot rollback

Docker is using the zfs storage driver on Ubuntu 18.04 as recommended.

I had to roll back my entire docker dataset; errors afterwards as follows:

$ docker-compose start
Starting db … error
Starting app … error

ERROR: for db Cannot start service db: error creating zfs mount: mount zpool/docker/796d1f0afa50ab467138a796a5f11402e81ea6c3c0621bdcfcb1c8f011575858:/zpool/docker/zfs/graph/796d1f0afa50ab467138a796a5f11402e81ea6c3c0621bdcfcb1c8f011575858: no such file or directory

Give docker a dummy zfs dataset (or two) to delete

Note: I don’t know if this is best docker practice - it worked for me and the system has been running smoothly for the last couple of days since.

$ sudo docker-compose down
Stopping nextcloud_db_1 … done
Removing nextcloud_db_1 … done
Removing nextcloud_app_1 … error
Removing 791e29c497de_nextcloud_db_1 … error
ERROR: for 791e29c497de_nextcloud_db_1 container 791e29c497de0d23b5aa2d61754e1128665b4f32da7212e89f8a2f698d80e53a: driver “zfs” failed to remove root filesystem: exit status 1: “/sbin/zfs fs destroy -r zpool/docker/796d1f0afa50ab467138a796a5f11402e81ea6c3c0621bdcfcb1c8f011575858” => cannot open ‘zpool/docker/796d1f0afa50ab467138a796a5f11402e81ea6c3c0621bdcfcb1c8f011575858’: dataset does not exist

ERROR: for nextcloud_app_1 container 87078fbd00466e8387ce9abc3d9699e341d54a31ac54032c1a316b5567e42791: driver “zfs” failed to remove root filesystem: exit status 1: “/sbin/zfs fs destroy -r zpool/docker/a2cc0d2662a427501636b7cb9d2e09b013cb7cfea6b75b67f3877e30783eefe2” => cannot open ‘zpool/docker/a2cc0d2662a427501636b7cb9d2e09b013cb7cfea6b75b67f3877e30783eefe2’: dataset does not exist

Create zfs datasets to destroy for:

Nextcloud Database

$ sudo zfs create zpool/docker/796d1f0afa50ab467138a796a5f11402e81ea6c3c0621bdcfcb1c8f011575858

$ sudo zfs set mountpoint=legacy zpool/docker/796d1f0afa50ab467138a796a5f11402e81ea6c3c0621bdcfcb1c8f011575858

$ sudo zfs create zpool/docker/796d1f0afa50ab467138a796a5f11402e81ea6c3c0621bdcfcb1c8f011575858-init

$ sudo zfs set mountpoint=legacy zpool/docker/796d1f0afa50ab467138a796a5f11402e81ea6c3c0621bdcfcb1c8f011575858-init

Nextcloud App

$ sudo zfs create zpool/docker/a2cc0d2662a427501636b7cb9d2e09b013cb7cfea6b75b67f3877e30783eefe2

$ sudo zfs create zpool/docker/a2cc0d2662a427501636b7cb9d2e09b013cb7cfea6b75b67f3877e30783eefe2-init

$ sudo zfs set mountpoint=legacy zpool/docker/a2cc0d2662a427501636b7cb9d2e09b013cb7cfea6b75b67f3877e30783eefe2

$ sudo zfs set mountpoint=legacy zpool/docker/a2cc0d2662a427501636b7cb9d2e09b013cb7cfea6b75b67f3877e30783eefe2-init

$sudo docker-compose up -d
(success, both app and db containers are running - still in maintenance mode though)

Log in to the container:
$ docker exec -it $(docker ps | awk ‘/apache/ {print $1;}’) su -s /bin/bash www-data
apache container$ php /var/www/html/occ maintenance:mode --off