Snap installation: connection refused Failed to load network & NULL sql description error

I’ve been using lxd for a while with no problems. I have two containers running most of the time. Snap periodically updates them in the background and I’ve got a simple (host) script that runs another script in the container and, when it stops (because snap has updated lxd), starts it again.

That’s worked well for ages, but today it stopped working (I’m guessing this is a result of a snap update, but I could be wrong) and I get this message (over and over again) in the terminal:

Error: Get "http://unix.socket/1.0": dial unix /var/snap/lxd/common/lxd/unix.socket: connect: connection refused

I get the same message if I run lxc list or sudo lxc list.

After reading a few webpages to try to figure out how to fix this (I really don’t know what I’m doing so I was clutching at straws a little), I tried the following:

sudo systemctl stop snap.lxd.daemon.service snap.lxd.daemon.unix.socket
sudo pkill -9 lxd
sudo lxd --debug --group lxd

That produced a long string of messages (included in full below). I think the problem seems to be this one:

EROR[10-17|16:51:41] Failed to start the daemon               err="Failed to load network \"lxdbr0\" in project \"default\": sql: Scan error on column index 2, name \"description\": converting NULL to string is unsupported"

The host is running Ubuntu 20.04.2 LTS.

Can anyone suggest what to do to fix this?

Full output of sudo lxd --debug --group lxd:

DBUG[10-17|16:51:37] Connecting to a local LXD over a Unix socket
DBUG[10-17|16:51:37] Sending request to LXD                   method=GET url=http://unix.socket/1.0 etag=
INFO[10-17|16:51:37] LXD is starting                          path=/var/snap/lxd/common/lxd version=4.19 mode=normal
INFO[10-17|16:51:37] Kernel uid/gid map:
INFO[10-17|16:51:37]  - u 0 0 4294967295
INFO[10-17|16:51:37]  - g 0 0 4294967295
INFO[10-17|16:51:37] Configured LXD uid/gid map:
INFO[10-17|16:51:37]  - u 0 1000000 1000000000
INFO[10-17|16:51:37]  - g 0 1000000 1000000000
INFO[10-17|16:51:37] Kernel features:
INFO[10-17|16:51:37]  - closing multiple file descriptors efficiently: no
INFO[10-17|16:51:37]  - netnsid-based network retrieval: yes
INFO[10-17|16:51:37]  - pidfds: yes
INFO[10-17|16:51:37]  - core scheduling: no
INFO[10-17|16:51:37]  - uevent injection: yes
INFO[10-17|16:51:37]  - seccomp listener: yes
INFO[10-17|16:51:37]  - seccomp listener continue syscalls: yes
INFO[10-17|16:51:37]  - seccomp listener add file descriptors: no
INFO[10-17|16:51:37]  - attach to namespaces via pidfds: no
INFO[10-17|16:51:37]  - safe native terminal allocation : yes
INFO[10-17|16:51:37]  - unprivileged file capabilities: yes
INFO[10-17|16:51:37]  - cgroup layout: hybrid
WARN[10-17|16:51:37]  - Couldn't find the CGroup blkio.weight, disk priority will be ignored
WARN[10-17|16:51:37]  - Couldn't find the CGroup memory swap accounting, swap limits will be ignored
INFO[10-17|16:51:37]  - shiftfs support: yes
INFO[10-17|16:51:39] Initializing local database
DBUG[10-17|16:51:39] Refreshing local trusted certificate cache
INFO[10-17|16:51:39] Set client certificate to server certificate fingerprint=2e8e6e09702c23314617e3f1c13bbe9503cf3a87653c72e4d15d37ee44b169d8
DBUG[10-17|16:51:39] Initializing database gateway
INFO[10-17|16:51:39] Starting database node                   id=1 address=1 role=voter
DBUG[10-17|16:51:40] Connecting to a local LXD over a Unix socket
DBUG[10-17|16:51:40] Sending request to LXD                   method=GET url=http://unix.socket/1.0 etag=
DBUG[10-17|16:51:40] Detected stale unix socket, deleting
INFO[10-17|16:51:40] Starting /dev/lxd handler:
INFO[10-17|16:51:40]  - binding devlxd socket                 socket=/var/snap/lxd/common/lxd/devlxd/sock
INFO[10-17|16:51:40] REST API daemon:
INFO[10-17|16:51:40]  - binding Unix socket                   socket=/var/snap/lxd/common/lxd/unix.socket
INFO[10-17|16:51:40] Initializing global database
INFO[10-17|16:51:40] Connecting to global database
DBUG[10-17|16:51:40] Dqlite: attempt 1: server 1: connected
INFO[10-17|16:51:40] Connected to global database
INFO[10-17|16:51:40] Initialized global database
INFO[10-17|16:51:40] Firewall loaded driver                   driver=nftables
INFO[10-17|16:51:40] Initializing storage pools
DBUG[10-17|16:51:41] Initializing and checking storage pool   pool=zfs.8000
DBUG[10-17|16:51:41] Mount started                            driver=zfs pool=zfs.8000
DBUG[10-17|16:51:41] Mount finished                           driver=zfs pool=zfs.8000
INFO[10-17|16:51:41] Initializing daemon storage mounts
INFO[10-17|16:51:41] Loading daemon configuration
INFO[10-17|16:51:41] Initializing networks
DBUG[10-17|16:51:41] Database error: &fmt.wrapError{msg:"sql: Scan error on column index 2, name \"description\": converting NULL to string is unsupported", err:(*errors.errorString)(0xc000403a80)}
EROR[10-17|16:51:41] Failed to start the daemon               err="Failed to load network \"lxdbr0\" in project \"default\": sql: Scan error on column index 2, name \"description\": converting NULL to string is unsupported"
INFO[10-17|16:51:41] Starting shutdown sequence               signal=interrupt
DBUG[10-17|16:51:41] Cancel ongoing or future gRPC connection attempts
INFO[10-17|16:51:41] Closing the database
INFO[10-17|16:51:41] Stop database gateway
INFO[10-17|16:51:41] Stopping REST API handler:
INFO[10-17|16:51:41]  - closing socket                        socket=/var/snap/lxd/common/lxd/unix.socket
INFO[10-17|16:51:41] Stopping /dev/lxd handler:
INFO[10-17|16:51:41]  - closing socket                        socket=/var/snap/lxd/common/lxd/devlxd/sock
INFO[10-17|16:51:41] Unmounting temporary filesystems
INFO[10-17|16:51:41] Done unmounting temporary filesystems
INFO[10-17|16:51:41] Daemon stopped
Error: Failed to load network "lxdbr0" in project "default": sql: Scan error on column index 2, name "description": converting NULL to string is unsupported

Please see this issue for a fix

1 Like

Thank you, that fixed it

1 Like