LXD doesn’t start snap.lxd.device: Directory nonexistent

Hello,

Since Today, lxd doesn’t start on one of my server, there is the error I get from
journalctl -u snap.lxd.daemon -n 50

I have lxd installed with snapd
snap info lxd:
installed: 6.3-a85d6a5 (33246) 116MB -

snap --version:
snap 2.61.4
snapd 2.61.4
series 16
debian 11
kernel 5.10.0-34-amd64

Apr 23 19:00:25 runbot01 systemd[1]: Stopped Service for snap application lxd.daemon.
Apr 23 19:00:25 runbot01 systemd[1]: Started Service for snap application lxd.daemon.
Apr 23 19:00:25 runbot01 lxd.daemon[3086]: INFO: the gpu-2404 interface isn’t connected. Skipping gpu-2404 wrapper.
Apr 23 19:00:25 runbot01 lxd.daemon[3086]: => Preparing the system (33246)
Apr 23 19:00:25 runbot01 lxd.daemon[3135]: grep: /var/lib/snapd/hostfs/var/lib/snapd/cgroup/snap.lxd.device: No such file or directory
Apr 23 19:00:25 runbot01 lxd.daemon[3086]: /snap/lxd/33246/commands/daemon.start: 46: cannot create /var/lib/snapd/hostfs/var/lib/snapd/cgroup/snap.lxd.device: Directory nonexistent
Apr 23 19:00:25 runbot01 systemd[1]: snap.lxd.daemon.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Apr 23 19:00:25 runbot01 systemd[1]: snap.lxd.daemon.service: Failed with result ‘exit-code’.
Apr 23 19:00:25 runbot01 systemd[1]: snap.lxd.daemon.service: Scheduled restart job, restart counter is at 5.
Apr 23 19:00:25 runbot01 systemd[1]: Stopped Service for snap application lxd.daemon.
Apr 23 19:00:25 runbot01 systemd[1]: snap.lxd.daemon.service: Start request repeated too quickly.
Apr 23 19:00:25 runbot01 systemd[1]: snap.lxd.daemon.service: Failed with result ‘exit-code’.
Apr 23 19:00:25 runbot01 systemd[1]: Failed to start Service for snap application lxd.daemon.

Can you help me to fix the error ?
Thanks

Thank you Jeremy for relaying this error along with useful version information!

I’ve proposed a (naive) workaround and we’ll see what others in the team think about it.

In the meantime, could you please test this workaround by doing as follow:

# Get patched daemon.start
wget https://raw.githubusercontent.com/canonical/lxd-pkg-snap/refs/heads/latest-edge/snapcraft/commands/daemon.start

# make the daemon.start executable
chmod +x daemon.start

# bind mount that new daemon.start
sudo mount -o ro,bind daemon.start /snap/lxd/current/commands/daemon.start

# restart LXD
sudo systemctl restart snap.lxd.daemon.service

Thank you

Update: the proposed workaround was merged so I’ve updated the download path. I’m still interested to hear from you @jeremy-eezee if that fixes the problem fully for you.

2 Likes

Thank you sdeziel1 for you quick fix, the PR fully fixed the problem, all containers and VMS are started.

2 Likes

We’ll get that into 6/candidate and then onto 6/stable ASAP. Thanks

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.