Container cannot be restarted when sharenfs (ZFS) is on

I have a virtual machine (Ubuntu 18.04) with ZFS filesystem and some LXD containers.

The default ZFS pool “lxdpool1” has a dataset for every container, eg.: lxdpool001/containers/gitea

I am sharing this dataset by running

zfs set sharenfs=on lxdpool001/containers/gitea
zfs share lxdpool001/containers/gitea
lxc stop gitea
lxc start gitea

Error: Failed to run: /snap/lxd/current/bin/lxd forkstart testzfsmount /var/snap/lxd/common/lxd/containers /var/snap/lxd/common/lxd/logs/testzfsmount/lxc.conf

How could I share without running into this?

What does lxc info gitea --show-log get you?

I tested with container testzfsmount (but with the same commands):

lxc testzfsmount 20200131162616.975 ERROR dir - storage/dir.c:dir_mount:198 - No such file or directory - Failed to mount “/var/snap/lxd/common/lxd/containers/testzfsmount/rootfs” on “/var/snap/lxd/common/lxc/”
lxc testzfsmount 20200131162616.975 ERROR conf - conf.c:lxc_mount_rootfs:1353 - Failed to mount rootfs “/var/snap/lxd/common/lxd/containers/testzfsmount/rootfs” onto “/var/snap/lxd/common/lxc/” with options “(null)”
lxc testzfsmount 20200131162616.975 ERROR conf - conf.c:lxc_setup_rootfs_prepare_root:3447 - Failed to setup rootfs for
lxc testzfsmount 20200131162616.975 ERROR conf - conf.c:lxc_setup:3550 - Failed to setup rootfs
lxc testzfsmount 20200131162616.975 ERROR start - start.c:do_start:1321 - Failed to setup container “testzfsmount”
lxc testzfsmount 20200131162616.975 ERROR sync - sync.c:__sync_wait:62 - An error occurred in another process (expected sequence number 5)
lxc testzfsmount 20200131162616.975 WARN network - network.c:lxc_delete_network_priv:3377 - Failed to rename interface with index 78 from “eth0” to its initial name “veth8b8ae6fe”
lxc testzfsmount 20200131162616.976 ERROR lxccontainer - lxccontainer.c:wait_on_daemonized_start:873 - Received container state “ABORTING” instead of “RUNNING”
lxc testzfsmount 20200131162616.976 ERROR start - start.c:__lxc_start:2039 - Failed to spawn container “testzfsmount”
lxc 20200131162617.139 WARN commands - commands.c:lxc_cmd_rsp_recv:135 - Connection reset by peer - Failed to receive response for command “get_state”
lxc testzfsmount 20200131162617.957 ERROR conf - conf.c:run_buffer:352 - Script exited with status 1
lxc testzfsmount 20200131162617.957 ERROR start - start.c:lxc_fini:1064 - Failed to run lxc.hook.post-stop for container “testzfsmount”

If I call mount I have

lxdpool001/containers/testzfsmount on /var/snap/lxd/common/lxd/storage-pools/lxdpool001/containers/testzfsmount type zfs (rw,xattr,posixacl)

I guess this additional mount point does not play well with LXC

Any idea what a workaround could look like?