Hi,
I have just been upgrading my laptop from Ubuntu 18:04 to 20:04 and the upgrade got stuck during the LXD uprade. The LXD upgrade GUI went dark and it never recovered, leaving the Ubuntu upgrade rather broken. After a number of rounds of applying updates from the terminal I now have the desktop environment back up, but LXD is broken. I think that it is stuck somewhere in the migration to the snap, perhaps the containers are still at the old location but Ubuntu thinks they should be in the snap?
sudo lxc list
Error: Get “http://unix.socket/1.0”: dial unix /var/snap/lxd/common/lxd/unix.socket: connect: connection refused
sudo systemctl status lxd
lxd.service - LSB: Container hypervisor based on LXC
Loaded: loaded (/etc/init.d/lxd; generated)
Active: failed (Result: timeout) since Thu 2021-04-29 20:16:19 CEST; 8min ago
Docs: man:systemd-sysv-generator(8)
Process: 1351 ExecStart=/etc/init.d/lxd start (code=killed, signal=TERM)
Apr 29 20:11:20 laptop lxd[1351]: Starting Container hypervisor based on LXC: lxd.
Apr 29 20:11:19 laptop systemd[1]: Starting LSB: Container hypervisor based on LXC…
Apr 29 20:16:19 laptop systemd[1]: lxd.service: start operation timed out. Terminating.
Apr 29 20:16:19 laptop systemd[1]: lxd.service: Failed with result ‘timeout’.
Apr 29 20:16:19 laptop systemd[1]: Failed to start LSB: Container hypervisor based on LXC.
I also notice that the lxdbr0 bridge is missing.
I saw an output that said I should run lxd.migrate but that also gives an error:
sudo lxd.migrate
=> Connecting to source server
error: Unable to connect to the source LXD: Get “http://unix.socket/1.0”: dial unix /var/lib/lxd/unix.socket: connect: connection refused
I have one container that is very important to me, so I hope that someone can help me get this working again.
Wow, that’s pretty special… Yeah, looks like wiping anything below 21 should do it.
You can create /var/snap/lxd/common/lxd/database/patch.global.sql containing: DELETE FROM networks_config WHERE id < 21
Then run lxd --debug --group lxd again and that should get you past that error at least.
This gets everything up and running, so long as the debig command is still running in the terminal, containers can be listed and started and stopped:
sudo lxd --debug --group lxd
INFO[04-29|23:08:02] LXD 4.0.5 is starting in normal mode path=/var/snap/lxd/common/lxd
INFO[04-29|23:08:02] Kernel uid/gid map:
INFO[04-29|23:08:02] - u 0 0 4294967295
INFO[04-29|23:08:02] - g 0 0 4294967295
INFO[04-29|23:08:02] Configured LXD uid/gid map:
INFO[04-29|23:08:02] - u 0 1000000 1000000000
INFO[04-29|23:08:02] - g 0 1000000 1000000000
INFO[04-29|23:08:02] Kernel features:
INFO[04-29|23:08:02] - closing multiple file descriptors efficiently: no
INFO[04-29|23:08:02] - netnsid-based network retrieval: yes
INFO[04-29|23:08:02] - pidfds: yes
INFO[04-29|23:08:02] - uevent injection: yes
INFO[04-29|23:08:02] - seccomp listener: yes
INFO[04-29|23:08:02] - seccomp listener continue syscalls: yes
INFO[04-29|23:08:02] - seccomp listener add file descriptors: no
INFO[04-29|23:08:02] - attach to namespaces via pidfds: no
INFO[04-29|23:08:02] - safe native terminal allocation : yes
INFO[04-29|23:08:02] - unprivileged file capabilities: yes
INFO[04-29|23:08:02] - cgroup layout: hybrid
WARN[04-29|23:08:02] - Couldn’t find the CGroup blkio.weight, disk priority will be ignored
WARN[04-29|23:08:02] - Couldn’t find the CGroup memory swap accounting, swap limits will be ignored
INFO[04-29|23:08:02] - shiftfs support: yes
INFO[04-29|23:08:02] Initializing local database
DBUG[04-29|23:08:02] Initializing database gateway
DBUG[04-29|23:08:02] Start database node id=1 address= role=voter
INFO[04-29|23:08:02] Starting /dev/lxd handler:
INFO[04-29|23:08:02] - binding devlxd socket socket=/var/snap/lxd/common/lxd/devlxd/sock
INFO[04-29|23:08:02] REST API daemon:
INFO[04-29|23:08:02] - binding Unix socket socket=/var/snap/lxd/common/lxd/unix.socket
INFO[04-29|23:08:02] - binding TCP socket socket=[::]:8443
INFO[04-29|23:08:02] Initializing global database
DBUG[04-29|23:08:02] Dqlite: attempt 0: server 1: connected
DBUG[04-29|23:08:02] Firewall xtables detected iptables is in use
INFO[04-29|23:08:02] Firewall loaded driver “xtables”
INFO[04-29|23:08:02] Initializing storage pools
DBUG[04-29|23:08:02] Initializing and checking storage pool “lxd”
DBUG[04-29|23:08:02] Mount started driver=zfs pool=lxd
DBUG[04-29|23:08:02] Mount finished driver=zfs pool=lxd
INFO[04-29|23:08:02] Initializing daemon storage mounts
INFO[04-29|23:08:02] Initializing networks
DBUG[04-29|23:08:03] Start driver=bridge network=lxdbr0
DBUG[04-29|23:08:03] Setting up network driver=bridge network=lxdbr0
DBUG[04-29|23:08:03] Stable MAC generated driver=bridge network=lxdbr0 seed=a3ec4489745999809f69bb2a34f119c37a1b56ead6885a030523944d84f3799b.0.1 hwAddr=00:16:3e:b7:46:60
DBUG[04-29|23:08:04] New task Operation: 7af3da6c-eada-407d-9f4d-4c16f64a5238
INFO[04-29|23:08:04] Pruning leftover image files
DBUG[04-29|23:08:04] Started task operation: 7af3da6c-eada-407d-9f4d-4c16f64a5238
INFO[04-29|23:08:04] Done pruning leftover image files
INFO[04-29|23:08:04] Loading daemon configuration
DBUG[04-29|23:08:04] Success for task operation: 7af3da6c-eada-407d-9f4d-4c16f64a5238
DBUG[04-29|23:08:04] Initialized inotify with file descriptor 26
DBUG[04-29|23:08:04] Initialising mounted disk ref counter driver=disk device=root project=default instance=lamp18
DBUG[04-29|23:08:04] MountInstance started driver=zfs pool=lxd instance=lamp18 project=default
DBUG[04-29|23:08:04] MountInstance finished driver=zfs pool=lxd instance=lamp18 project=default
INFO[04-29|23:08:04] Started seccomp handler path=/var/snap/lxd/common/lxd/seccomp.socket
DBUG[04-29|23:08:04] New task Operation: e53ab4d4-0e63-494e-91d2-2651d36e2bd1
INFO[04-29|23:08:04] Pruning expired images
DBUG[04-29|23:08:04] Started task operation: e53ab4d4-0e63-494e-91d2-2651d36e2bd1
INFO[04-29|23:08:04] Done pruning expired images
DBUG[04-29|23:08:04] Success for task operation: e53ab4d4-0e63-494e-91d2-2651d36e2bd1
DBUG[04-29|23:08:04] New task Operation: 73c61a35-309c-4dfe-8a22-5f57209130ba
INFO[04-29|23:08:04] Pruning expired instance backups
DBUG[04-29|23:08:04] Started task operation: 73c61a35-309c-4dfe-8a22-5f57209130ba
INFO[04-29|23:08:04] Done pruning expired instance backups
DBUG[04-29|23:08:04] Success for task operation: 73c61a35-309c-4dfe-8a22-5f57209130ba
DBUG[04-29|23:08:04] New task Operation: 563a2aaf-af17-4dc1-9d7e-a170681f247d
INFO[04-29|23:08:04] Expiring log files
DBUG[04-29|23:08:04] Started task operation: 563a2aaf-af17-4dc1-9d7e-a170681f247d
DBUG[04-29|23:08:04] New task Operation: d19d3adb-aced-4819-a604-e011ad623343
INFO[04-29|23:08:04] Updating images
DBUG[04-29|23:08:04] Started task operation: d19d3adb-aced-4819-a604-e011ad623343
INFO[04-29|23:08:04] Done expiring log files
INFO[04-29|23:08:04] Done updating images
DBUG[04-29|23:08:04] Success for task operation: d19d3adb-aced-4819-a604-e011ad623343
DBUG[04-29|23:08:04] Success for task operation: 563a2aaf-af17-4dc1-9d7e-a170681f247d
DBUG[04-29|23:08:04] New task Operation: 51a0f4ea-a5a7-46e9-aaff-5a3f8ad06070
INFO[04-29|23:08:04] Updating instance types
DBUG[04-29|23:08:04] Started task operation: 51a0f4ea-a5a7-46e9-aaff-5a3f8ad06070
INFO[04-29|23:08:04] Done updating instance types
DBUG[04-29|23:08:16] Success for task operation: 51a0f4ea-a5a7-46e9-aaff-5a3f8ad06070
However the debug does not finish by itself and so when I Ctrl - C out of the terminal a running container keeps running but lxc list and lxc start container give:
lxc list
Error: Get “http://unix.socket/1.0”: dial unix /var/snap/lxd/common/lxd/unix.socket: connect: no such file or directory
root@laptop:/home/gary# lxc stop lamp18
Error: Get “http://unix.socket/1.0”: dial unix /var/snap/lxd/common/lxd/unix.socket: connect: no such file or directory