lxd init fails with 'Address already in use'

Bug #1995194 reported by Heinrich Schuchardt
40
This bug affects 9 people
Affects Status Importance Assigned to Milestone
lxd (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Snapcraft failed due to missing lxdbr0. So I uninstalled the lxd snap rebooted and reinstalled the lxd snap.

lxd init fails to create lxdbr0:

$ lxd init
Would you like to use LXD clustering? (yes/no) [default=no]:
Do you want to configure a new storage pool? (yes/no) [default=yes]:
Name of the new storage pool [default=default]:
Name of the storage backend to use (btrfs, ceph, cephobject, dir, lvm, zfs) [default=zfs]:
Create a new ZFS pool? (yes/no) [default=yes]:
Would you like to use an existing empty block device (e.g. a disk or partition)? (yes/no) [default=no]:
Size in GiB of the new loop device (1GiB minimum) [default=30GiB]:
Would you like to connect to a MAAS server? (yes/no) [default=no]:
Would you like to create a new local network bridge? (yes/no) [default=yes]:
What should the new bridge be called? [default=lxdbr0]:
What IPv4 address should be used? (CIDR subnet notation, “auto” or “none”) [default=auto]:
What IPv6 address should be used? (CIDR subnet notation, “auto” or “none”) [default=auto]:
Would you like the LXD server to be available over the network? (yes/no) [default=no]:
Would you like stale cached images to be updated automatically? (yes/no) [default=yes]:
Would you like a YAML "lxd init" preseed to be printed? (yes/no) [default=no]:
Error: Failed to create local member network "lxdbr0" in project "default": The DNS and DHCP service exited prematurely: Process exited with non-zero value 2 ("dnsmasq: failed to create listening socket for 10.37.129.1: Address already in use")

$ lxc network show lxdbr0
If this is your first time running LXD on this machine, you should also run: lxd init
To start your first container, try: lxc launch ubuntu:22.04
Or for a virtual machine: lxc launch ubuntu:22.04 --vm

Error: Network not found

After I uninstalled the maas snap lxd init worked find.

Can we have a less cryptic message describing why lxdbr0 cannot be created?

Telling the user that an application that binds to all interfaces on port 53 is incompatible with LXD would be helpful.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in lxd (Ubuntu):
status: New → Confirmed
Revision history for this message
Steven Parker (sbparke) wrote :

You can also just:
sudo snap stop maas

Then init lxd

No need to remove the maas snap.

Revision history for this message
Simon Déziel (sdeziel) wrote :

If I'm reading the issue properly, that 10.37.129.1 address would be from the newly created `lxdbr0` bridge where LXD wants to setup a dnsmasq listener.

Now presumably that fails because something in MAAS (bind9?) raced with it and started a listener on it before dnsmasq got a chance.

IIRC, bind9 has a feature that spawns listeners on newly created interfaces, so maybe MAAS could turn that feature off to play more nicely with other listeners?

Revision history for this message
Simon Déziel (sdeziel) wrote :

https://bind9.readthedocs.io/en/v9.18.27/reference.html#namedconf-statement-automatic-interface-scan is the default enabled feature that causes bind9 to start the conflicting listener, or at least I think it is.

I believe this is more a bug with how MAAS configures bind9 than something LXD could improve on. LXD really needs that dnsmasq listener so bind9 taking it over is nothing LXD can do about.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.