Cannot start lxd-bridge.service when MAAS is managing DNS

Bug #1594317 reported by Gavin Panella
36
This bug affects 6 people
Affects Status Importance Assigned to Milestone
MAAS
Invalid
Medium
Unassigned
bind9 (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

$ sudo systemctl restart lxd-bridge.service
$ journalctl -u lxd-bridge.service
Jun 20 10:52:02 madagascar systemd[1]: Stopped LXD - network bridge.
Jun 20 10:52:02 madagascar systemd[1]: Starting LXD - network bridge...
Jun 20 10:52:03 madagascar lxd-bridge.start[3158]: dnsmasq: failed to create listening socket for 10.224.138.1: Address already in use
Jun 20 10:52:03 madagascar lxd-bridge.start[3158]: Failed to setup lxd-bridge.
Jun 20 10:52:03 madagascar systemd[1]: Started LXD - network bridge.

The address 10.224.138.1 is the subnet that lxdbr0 is trying to set up. If I stop bind9.service and start lxd-bridge.service again it works fine.

(There seems to be a bug in lxd-bridge.service here too; the unit logs "Failed to setup ..." then systemd says "Started LXD - network bridge". Seems like systemd is not being told that it didn't work.)

Revision history for this message
Mike Pontillo (mpontillo) wrote :

This is actually a bug in the bind9 package, from what I understand. I think LaMont is already giving it some thought.

no longer affects: bind
Changed in maas:
status: New → Invalid
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in bind9 (Ubuntu):
status: New → Confirmed
tags: added: cdo-qa foundations-engine
Revision history for this message
David A. Desrosiers (setuid) wrote :

Adding these two lines (specifically the second line) to /etc/bind/named.conf.options and restarting bind, should solve this for you:

listen-on-v6 { none; };
listen { !10.224.138.0/24; };

Revision history for this message
David A. Desrosiers (setuid) wrote :

Correction to my last comment (listen-on, not listen):

listen-on { !10.224.138.0/24; };

Revision history for this message
Zhanglei Mao (zhanglei-mao) wrote :

It seems not works on my side ( 18.04 ARM64). I have to add the listening IP explicitly.

ubuntu@infra1:/etc/bind$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu 18.04.2 LTS"

ubuntu@infra1:/etc/bind$ uname -a
Linux infra1 4.15.0-45-generic #48-Ubuntu SMP Tue Jan 29 16:32:18 UTC 2019 aarch64 aarch64 aarch64 GNU/Linux

ubuntu@infra1:/etc/bind$ cat /etc/bind/named.conf.options
..
options { directory "/var/cache/bind";
auth-nxdomain no;
listen-on-v6 { none; };
listen-on { 185.168.3.1; };
//listen-on { !10.54.224.0/24; };
//listen-on { any; };
include "/etc/bind/maas/named.conf.options.inside.maas"; };
ubuntu@infra1:/etc/bind$

Revision history for this message
Zhanglei Mao (zhanglei-mao) wrote :

to add floating ip too as:
listen-on { 185.168.3.1; 185.168.3.5; };

Revision history for this message
Jason Hobbs (jason-hobbs) wrote :

MAAS is installing bind9 and configuring it for its own purposes - it provides other config for bind, and it's perfectly reasonable to expect maas to configure it to only listen on interfaces MAAS wants to provide DNS services on.

Changed in maas:
status: Invalid → New
tags: added: cpe-onsite
Changed in maas:
status: New → Triaged
importance: Undecided → Low
Revision history for this message
Alexander Balderson (asbalderson) wrote :

This workaround doesnt seem to work for snapped maas applying the fix to /var/snap/maas/current/bind/named.conf.options.

Revision history for this message
Alexander Balderson (asbalderson) wrote :

subbing to field high,
the workaround for a new snapped install MaaS seems to be to install Maas into a container, but existing installs upgrading to Focal will run into this problem.

Revision history for this message
Adam Collard (adam-collard) wrote :

Can you `lxc network set lxdbr0 dns.mode=none` adjusting for the name of your bridge.

This will tell LXD to not manage DNS on the bridge, as per https://github.com/lxc/lxd/blob/master/doc/networks.md.

Note you might also want to disable DHCP: `lxc network set lxdbr0 ipv4.dhcp=false` and `lxc network set lxdbr0 ipv6.dhcp=false`

Changed in bind9 (Ubuntu):
status: Confirmed → Invalid
Revision history for this message
Alberto Donato (ack) wrote :

Could you please confirm if commands provided by Adam in #10 work for you?

Changed in maas:
status: Triaged → Incomplete
Revision history for this message
Björn Tillenius (bjornt) wrote :

I think we need to solve this somehow.

I'm thinking that we could re-use the 'allow_dns' flag on subnets. If it's False, we shouldn't listen on an address in that subnet.

I think it should be safe, since AFAIK, allow_dns is only used to determine whether the address should be returned in the DHCP response.

Changed in maas:
importance: Low → High
status: Incomplete → New
status: New → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for MAAS because there has been no activity for 60 days.]

Changed in maas:
status: Incomplete → Expired
Changed in maas:
status: Expired → Triaged
Revision history for this message
Jerzy Husakowski (jhusakowski) wrote :

We plan to implement Bjorn's suggestion to re-use the 'allow_dns' flag on subnets. Note that this may be a breaking change for users who rely on the current default behaviour.

Changed in maas:
importance: High → Medium
milestone: none → 3.3.0
tags: added: dns-modeling
Changed in maas:
milestone: 3.3.0 → 3.4.0
no longer affects: maas/3.3
Revision history for this message
Jerzy Husakowski (jhusakowski) wrote :

This improvement in DNS handling has been moved to an internal backlog for future prioritisation (internal ref PF-3954).

Changed in maas:
milestone: 3.4.0 → none
status: Triaged → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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