Error: Failed to run: zfs mount default/containers/farmer420: cannot mount 'default/containers/farmer420': filesystem already mounted

,

Hi
from time to time lxc file pull or lxc exec start giving error
Error: Failed to run: zfs mount default/containers/farmer420: cannot mount 'default/containers/farmer420': filesystem already mounted
to resolve the issue i have to reboot the server. Please share any way to avoid this error .

LXD LOGS:
lxd.log.1:t=2021-03-17T16:56:00+0000 lvl=eror msg=“Failed to register device” device=root err=“Failed to run: zfs mount default/containers/farmer420: cannot mount ‘default/containers/farmer420’: filesystem already mounted” instance=farmer420 instanceType=container project=default
lxd.log.1:t=2021-03-19T14:06:58+0000 lvl=info msg="Creating cont

It’s a somewhat rare but known issue that we’re still trying to get to the bottom off.
https://github.com/lxc/lxd-pkg-snap has an issue for it.

You should also find very many similar mentions on this forum with our usual way to recover from it without a reboot.

@stgraber thanks for the reply so this issue does not occur in legacy apt install lxc??
if that’s the case then what do you recommend snap or the legacy apt method for seamless lxc environment.

We’ve not had that kind of report on legacy LXC indeed, though the user experience of legacy LXC is very very different from that of LXD and its use of advanced storage like ZFS is minimal.

That comes with the advantage of not hitting some of those more complex issues but with the significant downside of making just about everything else significantly harder :slight_smile:

Thanks @stgraber

Is there a possiblity this issue is appearing in any specific version of LXD. We are using LXD 4 stable version and still observing this behavior randomly in multiple servers.

It’s not related to a particular LXD version but as far as we can tell to the use of ZFS combined with a particular sequence of refresh of the core, core18 and lxd snaps. It tends to hit machines with high uptime more than those which are rebooted weekly for security updates (which is likely why we’ve never seen it on any of our system as we reboot them all after every kernel update).