root@cmp4rpp-h1:/var/snap/lxd/common/lxd/disks# sudo nsenter --mount=/run/snapd/ns/lxc.mnt mount -o loop /var/snap/lxd/common/lxd/disks/local.img /var/snap/lxd/common/lxd/storage-pools/local/
nsenter: cannot open /run/snapd/ns/lxc.mnt: No such file or directory
Oh yeah, that was a typo, what happened with sudo nsenter --mount=/run/snapd/ns/lxd.mnt mount -o loop /var/snap/lxd/common/lxd/disks/local.img /var/snap/lxd/common/lxd/storage-pools/local/ ?
root@cmp4rpp-h1:/var/snap/lxd/common/lxd/disks# lxc import WebServices
Error: open /var/snap/lxd/common/lxd/disks/WebServices: no such file or directory
Okay, now we’re back on track! I’ll get these container’s back into the system, properly export them then reload the host. Is LXC import/export still the way to go.
Yeah, lxd import will perform the disaster recovery to re-generate the DB entries, your containers should then work as normal.
If you have multiple systems, doing a lxc copy or lxc move over the network is usually a fair bit faster than export+import but if you need an offline storage solution, then lxc export is the way to go.
For what it’s worth: I had exactly this issue. Installed lxd (via snap) on Ubuntu 20.04 (after upgrading it from 18.04). It worked at first, but now I wanted to work with some containers it gave me this error. Processes got stuck. Database has address 0.
I compared the database.pre-migration database, and it looks like the raft_nodes were not properly migrated, ie. changed from the actual IP-adres and port to “0”. If I put that value for the raft_nodes back I get 404 errors.
I have ZFS, I tried doing an import of my containers, but they suddenly appear empty even.
Rather problematic, the upgrade and migration that happened in May?
Yet the fix was to stop lxd (via snap), reset the raft_nodes value back to the IP-address and port it previously had, and start again. On a “live system” that gave an error, but stop/start worked.
I tried the lxd import, but that didn’t work well for me in zfs. I probably had to configure lxd to use ZFS first given the database was cleared out, before doing an import? (I assumed I didn’t need an nsenter.)
Glad I was able to recover, but hope to understand what went wrong and ways to prevent this. Kind of fear the automatic upgrades that snap is doing at the moment.