core.metrics_address set to an IP assigned LXD-controlled interface makes server restart fail
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.
Not sure whether this should be specified in the documentation or it is to be treated as an error.
Originally reported here.
@pmarini please can you advise what the output of lxc network show <network> was to what core.metrics_address was set to?
# lxc network show br-csc
config:
ipv4.address: 10.246.192.1/24
ipv4.nat: "true"
ipv6.address: none
description: Common Network Interface for central services (csc)
name: br-csc
type: bridge
used_by:
- /1.0/instances/c1?project=prj1
- /1.0/instances/c2?project=prj2
- ....
managed: true
status: Created
locations:
- none
@escabo want to take this one, it should be very similar to https://github.com/canonical/lxd/pull/13204
@nmezhenskyi did you fix this one already?
@tomponline I and @escabo could not reproduce this issue.
Thanks. Metrics listener is started after managed networks https://github.com/canonical/lxd/blob/main/lxd/daemon.go#L1778 so looks like it is fixed.