Cannot start since update. Old snapshots block lxd start

Hi,

Since:
last update (PureOs and snap install)

Problem:
LXC/LXD do not start.
No lxc command works, with:

"sudo journalctl -r -n 200 -b -g lxd" shows:
> Error: Get "http://unix.socket/1.0": EOF
"sudo journalctl -r -n 200 -b -g lxd" shows:
mai 21 16:26:36 l6 lxd.daemon[41168]: Error: Failed applying patch "storage_delete_old_snapshot_records": Unvailable storage pools: [impool lxd2]
mai 21 16:26:35 l6 lxd.daemon[41168]: time="2023-05-21T16:26:35+02:00" level=error msg="Failed to start the daemon" err="Failed applying patch \"storage_delete_old_snapshot_records\": Unvailable storage pools: [impool lxd2]"
mai 21 16:26:35 l6 lxd.daemon[41168]: time="2023-05-21T16:26:35+02:00" level=error msg="Failed mounting storage pool" err="Failed to mount \"/dev/disk/by-uuid/3a09e126-d2a2-4615-9ffb-669bdf408ebc\" on \"/var/snap/lxd/common/lxd/storage-pools/lxd2\" using \"btrfs\": no such file or directory" pool=lxd2

mai 21 16:26:25 l6 lxd.daemon[41168]: time="2023-05-21T16:26:25+02:00" level=error msg="Failed mounting storage pool" err="Failed to mount \"/dev/disk/by-uuid/6110ba12-cd4d-4044-9384-c3879b5a2de6\" on \"/var/snap/lxd/common/lxd/storage-pools/impool\" using \"btrfs\": no such file or directory" pool=impool

mai 21 16:26:15 l6 lxd.daemon[41005]: => Starting LXD
mai 21 16:26:14 l6 systemd[1]: Started Service for snap application lxd.daemon.
mai 21 16:26:14 l6 systemd[1]: Stopped Service for snap application lxd.daemon.
mai 21 16:26:14 l6 systemd[1]: snap.lxd.daemon.service: Scheduled restart job, restart counter is at 20.
mai 21 16:26:14 l6 systemd[1]: snap.lxd.daemon.service: Failed with result 'exit-code'.
mai 21 16:26:14 l6 systemd[1]: snap.lxd.daemon.service: Main process exited, code=exited, status=1/FAILURE
mai 21 16:26:14 l6 lxd.daemon[40753]: => LXD failed to start

systemctl status snap.lxd.daemon:
● snap.lxd.daemon.service - Service for snap application lxd.daemon
     Loaded: loaded (/etc/systemd/system/snap.lxd.daemon.service; static)
     Active: active (running) since Sun 2023-05-21 18:04:34 CEST; 21s ago
TriggeredBy: ● snap.lxd.daemon.unix.socket
   Main PID: 43620 (daemon.start)
      Tasks: 0 (limit: 9830)
     Memory: 360.0K
        CPU: 200ms
     CGroup: /system.slice/snap.lxd.daemon.service
             ‣ 43620 /bin/sh /snap/lxd/24871/commands/daemon.start
SQL commands:
no finding about these pools

Context: “impool” and “lxd2” are two old pools that i lost from disk failure, then i reinstalled new pools on about 4 months ago. It looks that there is a “memory” of these 2 pools that blocking the system.

Tried:
restart computer, services
deleting the folders impool and lxd2 pools in /var/snap/lxd/common/lxd/storage-pools/, but they reappear.
I found no way to manage the “storage_delete_old_snapshot_records”

Help ! Thanks for your help.

SOLUTION :

lxd sql global 'select * from storage_pools'
lxd sql global 'delete from storage_pools where id=x'

2 Likes

it helped me, thanks

1 Like