In your case, you’ve likely just upgraded and jumped several releases such as to miss the interim release that just detected these issues and gave the error seen in those other reports, and instead got caught out by the schema change we added to prevent the issue happening in the future.
Please could you provide the output of:
sudo sqlite3 /var/snap/lxd/common/lxd/database/global/db.bin
sqlite> SELECT * FROM networks;
sqlite> SELECT * FROM networks_config;
Sorry for the delay. Got tied up doing other things, and it’s “only” my laptop that’s broken. The desktop is working fine and that’s where I tend to use lxc (apart from my server, where I use it for lots of things )
I think it’s entirely possible that I’ve jumped versions (or even broken things by messing around with the snap – I ran out of diskspace and had to uninstall things, then re-install them once I’d managed to move stuff around). So, I suspect this is entirely my fault!
Dumps as requested:
~$ sudo sqlite3 /var/snap/lxd/common/lxd/database/global/db.bin
SQLite version 3.31.1 2020-01-27 19:55:54
Enter ".help" for usage hints.
sqlite> SELECT * FROM networks;
1|1|lxdbr0||1|0
sqlite> SELECT * FROM networks_config;
2|1||ipv4.address|none
11|1||ipv4.dhcp.ranges|172.16.1.2-172.16.1.200
12|1||ipv4.nat|true
13|1||ipv6.address|none
14|1||dns.mode|dynamic
15|1||ipv4.address|172.16.1.1/20
So the issue is that the ipv4.address field’s setting is specified twice, rows 2 none and 15 172.16.1.1/20.
Assuming that the latter ID row 15 is the most recently specified and thus the one you actually want to keep, then we need to remove the row ID 2 from the networks_config table.
As LXD won’t start, to do this we use a patch SQL file which LXD runs at start up, to correct the error.
So as per the other threads, you’d need to create a file called /var/snap/lxd/common/lxd/database/patch.global.sql containing: