Https://discuss.linuxcontainers.org/t/lxd-daemon-starts-too-early-in-the-latest-lxd-snap-and-fails-to-join-the-cluster/13389

in the latest snap lxd daemon starts too early and then fails to connect to the cluster because it can not resolve its own name.

Feb 14 18:47:43 localhost.localdomain lxd.daemon[2936]: t=2022-02-14T18:47:43+0100 lvl=warn msg="AppArmor support has been disabled because of lack of kernel support"
Feb 14 18:47:43 localhost.localdomain lxd.daemon[2936]: t=2022-02-14T18:47:43+0100 lvl=warn msg=" - AppArmor support has been disabled, Disabled because of lack of kernel support"
Feb 14 18:47:43 localhost.localdomain lxd.daemon[2936]: t=2022-02-14T18:47:43+0100 lvl=warn msg=" - Couldn't find the CGroup blkio.weight, disk priority will be ignored"
Feb 14 18:47:43 localhost.localdomain lxd.daemon[2936]: t=2022-02-14T18:47:43+0100 lvl=eror msg="Invalid configuration key: Couldn't resolve \"lxd13\"" key=cluster.https_address
Feb 14 18:47:43 localhost.localdomain lxd.daemon[2936]: t=2022-02-14T18:47:43+0100 lvl=eror msg="Invalid configuration key: Couldn't resolve \"lxd13\"" key=core.https_address
Feb 14 18:47:43 localhost.localdomain lxd.daemon[2936]: t=2022-02-14T18:47:43+0100 lvl=eror msg="Invalid configuration key: Couldn't resolve \"lxd13\"" key=cluster.https_address
Feb 14 18:47:43 localhost.localdomain lxd.daemon[2936]: t=2022-02-14T18:47:43+0100 lvl=eror msg="Invalid configuration key: Couldn't resolve \"lxd13\"" key=core.https_address
Feb 14 18:47:43 localhost.localdomain lxd.daemon[2936]: t=2022-02-14T18:47:43+0100 lvl=eror msg="Invalid configuration key: Couldn't resolve \"lxd13\"" key=cluster.https_address
Feb 14 18:47:43 localhost.localdomain lxd.daemon[2936]: t=2022-02-14T18:47:43+0100 lvl=eror msg="Invalid configuration key: Couldn't resolve \"lxd13\"" key=core.https_address
Feb 14 18:47:43 localhost.localdomain lxd.daemon[2936]: t=2022-02-14T18:47:43+0100 lvl=eror msg="Invalid configuration key: Couldn't resolve \"lxd13\"" key=cluster.https_address
Feb 14 18:47:43 localhost.localdomain lxd.daemon[2936]: t=2022-02-14T18:47:43+0100 lvl=eror msg="Invalid configuration key: Couldn't resolve \"lxd13\"" key=core.https_address
Feb 14 18:47:43 localhost.localdomain lxd.daemon[2936]: t=2022-02-14T18:47:43+0100 lvl=eror msg="Invalid configuration key: Couldn't resolve \"lxd13\"" key=cluster.https_address
Feb 14 18:47:43 localhost.localdomain lxd.daemon[2936]: t=2022-02-14T18:47:43+0100 lvl=eror msg="Invalid configuration key: Couldn't resolve \"lxd13\"" key=core.https_address
Feb 14 18:47:43 localhost.localdomain lxd.daemon[2936]: t=2022-02-14T18:47:43+0100 lvl=warn msg="Dqlite: attempt 1: server 1: no known leader"
Feb 14 18:47:44 localhost.localdomain lxd.daemon[2936]: t=2022-02-14T18:47:44+0100 lvl=warn msg="Dqlite: attempt 2: server 1: no known leader"

I have cluster and core addresses set to hostnames, not sure if this is the right way to do it? I would rather not put an IP address in there in case I decide to renumber hosts later via DHCP. What is the recommended way to configure cluster and core address of a cluster member that has a potentially floating IP?

I see that snap.ldx.daemon service currently starts after network.target, but that’s not the time when you can do anything useful with the network, so even if I stick my cluster members in /etc/hosts, it will still try to connect too early.

I have “fixed” this by overriding the After= in the systemd unit to say After=network-online.target, but would rather that to be fixed upstream if possible.

1 Like