LXD Error: lxd.user-daemon[3615]: Error: Unable to connect to LXD: Get "http://unix.socket/1.0": dial unix /var/snap/lxd/common/lxd/unix.socket: connect: no such file or directory

Hi, after an reboot lxd refuses to start

lxd --debug --group lxd output shows that it can’t bind to a network address, I configured the metrics address to listen to the lxd bridge ip 10.117.221.1:8444 and it seems that’s why lxd can’t start. Is there a another way to configure the metrics address besides an lxc command? I can’t use the lxc command because lxd isn’t up.

INFO   [2023-11-30T08:40:47+01:00] LXD is starting                               mode=normal path=/var/snap/lxd/common/lxd version=5.0.2
INFO   [2023-11-30T08:40:47+01:00] Kernel uid/gid map:
INFO   [2023-11-30T08:40:47+01:00]  - u 0 0 4294967295
INFO   [2023-11-30T08:40:47+01:00]  - g 0 0 4294967295
INFO   [2023-11-30T08:40:47+01:00] Configured LXD uid/gid map:
INFO   [2023-11-30T08:40:47+01:00]  - u 0 1000000 1000000000
INFO   [2023-11-30T08:40:47+01:00]  - g 0 1000000 1000000000
INFO   [2023-11-30T08:40:47+01:00] Kernel features:
INFO   [2023-11-30T08:40:47+01:00]  - closing multiple file descriptors efficiently: yes
INFO   [2023-11-30T08:40:47+01:00]  - netnsid-based network retrieval: yes
INFO   [2023-11-30T08:40:47+01:00]  - pidfds: yes
INFO   [2023-11-30T08:40:47+01:00]  - core scheduling: no
INFO   [2023-11-30T08:40:47+01:00]  - uevent injection: yes
INFO   [2023-11-30T08:40:47+01:00]  - seccomp listener: yes
INFO   [2023-11-30T08:40:47+01:00]  - seccomp listener continue syscalls: yes
INFO   [2023-11-30T08:40:47+01:00]  - seccomp listener add file descriptors: yes
INFO   [2023-11-30T08:40:47+01:00]  - attach to namespaces via pidfds: yes
INFO   [2023-11-30T08:40:47+01:00]  - safe native terminal allocation : yes
INFO   [2023-11-30T08:40:47+01:00]  - unprivileged file capabilities: yes
INFO   [2023-11-30T08:40:47+01:00]  - cgroup layout: cgroup2
WARNING[2023-11-30T08:40:47+01:00]  - Couldn't find the CGroup hugetlb controller, hugepage limits will be ignored
WARNING[2023-11-30T08:40:47+01:00]  - Couldn't find the CGroup network priority controller, network priority will be ignored
INFO   [2023-11-30T08:40:47+01:00]  - shiftfs support: yes
INFO   [2023-11-30T08:40:47+01:00]  - idmapped mounts kernel support: yes
INFO   [2023-11-30T08:40:47+01:00] Instance type operational                     driver=lxc features="[]" type=container
WARNING[2023-11-30T08:40:47+01:00] Instance type not operational                 driver=qemu err="KVM support is missing (no /dev/kvm)" type=virtual-machine
INFO   [2023-11-30T08:40:47+01:00] Initializing local database
DEBUG  [2023-11-30T08:40:47+01:00] Refreshing local trusted certificate cache
INFO   [2023-11-30T08:40:47+01:00] Set client certificate to server certificate  fingerprint=5db4b859450bfc3df357e6042734fe4fd4b7c0c93a713bab9ed81d706c598d60
DEBUG  [2023-11-30T08:40:47+01:00] Initializing database gateway
INFO   [2023-11-30T08:40:47+01:00] Starting database node                        id=1 local=1 role=voter
INFO   [2023-11-30T08:40:47+01:00] Loading daemon configuration
INFO   [2023-11-30T08:40:47+01:00] Closing socket                                socket=/var/snap/lxd/common/lxd/unix.socket type="REST API Unix socket"
INFO   [2023-11-30T08:40:47+01:00] Closing socket                                socket=/var/snap/lxd/common/lxd/devlxd/sock type="devlxd socket"
ERROR  [2023-11-30T08:40:47+01:00] Failed to start the daemon                    err="Bind network address: listen tcp 10.117.221.1:8444: bind: cannot assign requested address"
INFO   [2023-11-30T08:40:47+01:00] Starting shutdown sequence                    signal=interrupt
DEBUG  [2023-11-30T08:40:47+01:00] Cancel ongoing or future gRPC connection attempts
INFO   [2023-11-30T08:40:47+01:00] Stop database gateway
INFO   [2023-11-30T08:40:47+01:00] Not unmounting temporary filesystems (instances are still running)
INFO   [2023-11-30T08:40:47+01:00] Daemon stopped
Error: Bind network address: listen tcp 10.117.221.1:8444: bind: cannot assign requested address

Your daemon was configured to use the address 10.117.221.1 but your system doesn’t appear to have that address at the moment, causing the startup failure.

You can probably workaround that with ip a add dev lo 10.117.221.1/32