Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Failed to open cluster database - Can't start/do anything with LXD #4808
I'm trying to run/start LXD, but can't do anything (all commands are executed as root).
Trying to start it, just make the command run forever without starting LXD
If I watch the logs while trying to start LXD, here are the results :
Do you know what is going on with my setup ?
It looks like the information stored in the database is inconsistent. There should be a row matching the node's address. I'm not sure how things ended up here, did you experience some other failure prior this one?
From the logs it looks like you are not exposing your node on the network (i.e. you answered "no" to the "Would you like LXD to be available over the network? " question from lxd init, and you didn't set a network address afterwise). Can you confirm that?
If that is the case, we can probably fix the situation with a one-off database query. Please try to create a /var/lib/lxd/database/global/patch.global.sql file with this content:
and start the daemon again.
Well, if I try this, starting LXD again, seems to do nothing more (same log as above).
What I tried, is to remove the database (local.db and global folder from /var/lib/lxd/database/), removing LXD package et re-installing it again.
So I try to start it for the first time
If I then kill the
After that I come back to the starting point, of not being able to do anything and everything ends with a
Ok, so the "Error: failed to open cluster database: failed to ensure schema: failed to update node version info: updated 0 rows instead of 1" is most probably a consequence of the first failure ("panic: cannot free page 0 or 1: 0").
I'm not sure why the first failure happens, we've never seen it before. Perhaps a disk failure? I'll have to dig into boltdb's code to know.
@Julien-Marcou I gave a look at your database, and the solution I first gave you is actually working, except that I had given you the wrong path for the SQL patch file :/
Here's the correct path and content:
After that file is in place, you should be able to start the daemon again.
Sorry for the late answer, it indeed worked and I could start LXD, but I'm now experiencing a lot of other issues :
I had to manually create the bridge with
But there is something I didn't tell, I'm trying this on Windows Subsystem for Linux (aka WSL) with the last Windows 10 update of April 2018. And it make no doubt it is still not ready to be used with LXD as I have no problem using LXD on a real linux system.
I'll call this experiment a fail :-(
Oh yeah, there's no way you can run LXD under WSL. I'm actually very surprised you got that far.
WSL doesn't support namespaces, cgroups or as you noticed, more complex networking, all of which are needed for LXD to work. I think a basic cgroup implementation is planned but I doubt that they have any intention to do complex networking in there and supporting all the container features (namespaces, seccomp, apparmor, ...) would take them years to reverse engineer and re-implement so seems very doubtful that it'd ever make it on their roadmap.