Core.metrics_address set to an IP assigned LXD-controlled interface

While setting up metrics monitoring for the LXD server I operate, I set core.metrics_address to an IP assigned by a LXD-controlled network interface.

At the same time, I wanted to change server.crt and server.key to a CA-signed certificate and key, so I had to restart the service.

However the service refused to start throwing the error:

level=error msg="Failed to start the daemon" err="Bind network address: listen tcp 10.246.192.1:8444: bind: cannot assign requested address"

To resolve the issue I had to install the sqlite client, understand the database model and finally delete the line corresponding to core.metrics_address in the config table.

While the error probably has its technical reasons, a few questions here:

  1. wouldn’t be convenient to clarify in the documentation to not use a LXD-controlled IP address for core.host_address and core.metrics_address?
  2. wouldn’t be convenient to document the proper way to troubleshoot this kind of scenario, providing some guidance for a direct access to the db (not via lxd sql) and the database model and dictionary?

DQLITE doesn’t provide a file you can access with sqlite3 command that applies modifications (it does provide a file called db.bin which can be used to view the database with sqlite3).

Instead you can use the DB patch process to apply changes on start up:

https://documentation.ubuntu.com/lxd/en/latest/debugging/#running-custom-queries-at-lxd-daemon-startup

Please could you open an issue wrt to the bind error as I believe there should be logic to understand this scenario, https://github.com/canonical/lxd/issues, as people do tend to do this from time to time.

Please could you open an issue wrt to the bind error as I believe there should be logic to understand this scenario, https://github.com/canonical/lxd/issues , as people do tend to do this from time to time.

https://github.com/canonical/lxd/issues/12185

DQLITE doesn’t provide a file you can access with sqlite3 command that applies modifications (it does provide a file called db.bin which can be used to view the database with sqlite3).

Instead you can use the DB patch process to apply changes on start up:

https://documentation.ubuntu.com/lxd/en/latest/debugging/#running-custom-queries-at-lxd-daemon-startup

I saw that. But if you want to perform some sql with DB patch process you still need to understand which query should be run, design it and see the data it must be run on. This is why a direct access to the db would be beneficial (in my case, a not-clustered server, sqlite3 was working fine) as well as data dictionary. Of course this comes with a huge risk to break things, but users can be warned about it.

Because of the way dqlite works, direct DB access when LXD isn’t running isn’t possible.

Ok. I think it could be useful to have a data dictionary in the documentation to prepare queries that must be passed in the DB patch process.

You can use the db.bin file with sqlite3 to ascertain the contents of the DB when LXD shutdown.