lxd icon indicating copy to clipboard operation
lxd copied to clipboard

core.metrics_address set to an IP assigned LXD-controlled interface makes server restart fail

Open pmarini opened this issue 2 years ago • 3 comments

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 avatar Aug 29 '23 12:08 pmarini

@pmarini please can you advise what the output of lxc network show <network> was to what core.metrics_address was set to?

tomponline avatar Sep 06 '23 07:09 tomponline

# 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

pmarini avatar Sep 06 '23 15:09 pmarini

@escabo want to take this one, it should be very similar to https://github.com/canonical/lxd/pull/13204

tomponline avatar Apr 24 '24 07:04 tomponline

@nmezhenskyi did you fix this one already?

tomponline avatar Apr 29 '25 21:04 tomponline

@tomponline I and @escabo could not reproduce this issue.

nmezhenskyi avatar Apr 29 '25 21:04 nmezhenskyi

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.

tomponline avatar Apr 29 '25 22:04 tomponline