Failed configuring DHCP on rack controller
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MAAS |
Fix Committed
|
High
|
Jacopo Rota | ||
3.5 |
Fix Released
|
High
|
Anton Troyanov |
Bug Description
Running MAAS 3.5.0-beta1 in a vanilla LXD container with 2 interfaces.
Steps to reproduce:
1) create a container with 1 interface, start it and install maas.
2) stop the container and add another interface.
3) start the container and configure the interface and restart maas
4) BUM
eth1 is controlled by MAAS, and as soon as I enable DHCP via UI DHCP service goes into a crash-loop.
root@maas-deb:~# cat /etc/netplan/
# This file is generated from information provided by the datasource. Changes
# to it will not persist across an instance reboot. To disable cloud-init's
# network configuration capabilities, write a file
# /etc/cloud/
# network: {config: disabled}
network:
version: 2
ethernets:
eth0:
dhcp4: true
eth1:
dhcp4: false
root@maas-deb:~# apt-cache madison maas
maas | 1:3.5.0~
```
Mar 05 20:47:43 maas-deb regiond[611]: maasserver.dhcp: [critical] Error configuring DHCPv4 on rack controller 'maas-deb (xgbk8d)': DHCPv4 server failed to restart: Service 'maas-dhcpd' failed to restart. Its current state is 'SERVICE_STATE.OFF' and 'dead'.
Mar 05 20:47:43 maas-deb regiond[611]: Traceback (most recent call last):
Mar 05 20:47:43 maas-deb regiond[611]: --- <exception caught here> ---
Mar 05 20:47:43 maas-deb regiond[611]: File "/usr/lib/
Mar 05 20:47:43 maas-deb regiond[611]: yield client(
Mar 05 20:47:43 maas-deb regiond[611]: File "/usr/lib/
Mar 05 20:47:43 maas-deb regiond[611]: current.result = callback( # type: ignore[misc]
Mar 05 20:47:43 maas-deb regiond[611]: File "/usr/lib/
Mar 05 20:47:43 maas-deb regiond[611]: failure.
Mar 05 20:47:43 maas-deb regiond[611]: File "/usr/lib/
Mar 05 20:47:43 maas-deb regiond[611]: raise self.value.
Mar 05 20:47:43 maas-deb regiond[611]: provisioningser
Mar 05 20:47:43 maas-deb regiond[611]:
Mar 05 20:47:43 maas-deb regiond[611]: maasserver.dhcp: [info] Successfully configured DHCPv6 on rack controller 'maas-deb (xgbk8d)'.
Mar 05 20:47:43 maas-deb regiond[611]: maasserver.
Mar 05 20:47:43 maas-deb regiond[611]: Traceback (most recent call last):
Mar 05 20:47:43 maas-deb regiond[611]: File "/usr/lib/
Mar 05 20:47:43 maas-deb regiond[611]: current_
Mar 05 20:47:43 maas-deb regiond[611]: File "/usr/lib/
Mar 05 20:47:43 maas-deb regiond[611]: status.
Mar 05 20:47:43 maas-deb regiond[611]: File "/usr/lib/
Mar 05 20:47:43 maas-deb regiond[611]: self._startRunC
Mar 05 20:47:43 maas-deb regiond[611]: File "/usr/lib/
Mar 05 20:47:43 maas-deb regiond[611]: self._runCallba
Mar 05 20:47:43 maas-deb regiond[611]: --- <exception caught here> ---
Mar 05 20:47:43 maas-deb regiond[611]: File "/usr/lib/
Mar 05 20:47:43 maas-deb regiond[611]: current.result = callback( # type: ignore[misc]
Mar 05 20:47:43 maas-deb regiond[611]: File "/usr/lib/
Mar 05 20:47:43 maas-deb regiond[611]: d.addErrback(lambda f: f.trap(
Mar 05 20:47:43 maas-deb regiond[611]: File "/usr/lib/
Mar 05 20:47:43 maas-deb regiond[611]: self.raiseExcep
Mar 05 20:47:43 maas-deb regiond[611]: File "/usr/lib/
Mar 05 20:47:43 maas-deb regiond[611]: raise self.value.
Mar 05 20:47:43 maas-deb regiond[611]: File "/usr/lib/
Mar 05 20:47:43 maas-deb regiond[611]: current.result = callback( # type: ignore[misc]
Mar 05 20:47:43 maas-deb regiond[611]: File "/usr/lib/
Mar 05 20:47:43 maas-deb regiond[611]: f.trap(
Mar 05 20:47:43 maas-deb regiond[611]: File "/usr/lib/
Mar 05 20:47:43 maas-deb regiond[611]: self.raiseExcep
Mar 05 20:47:43 maas-deb regiond[611]: File "/usr/lib/
Mar 05 20:47:43 maas-deb regiond[611]: raise self.value.
Mar 05 20:47:43 maas-deb regiond[611]: File "/usr/lib/
Mar 05 20:47:43 maas-deb regiond[611]: result = current_
Mar 05 20:47:43 maas-deb regiond[611]: File "/usr/lib/
Mar 05 20:47:43 maas-deb regiond[611]: raise ipv4_exc
Mar 05 20:47:43 maas-deb regiond[611]: File "/usr/lib/
Mar 05 20:47:43 maas-deb regiond[611]: yield client(
Mar 05 20:47:43 maas-deb regiond[611]: provisioningser
```
Related branches
- Jacopo Rota: Approve
-
Diff: 234 lines (+19/-24)13 files modifieddebian/maas-agent.dirs (+0/-1)
debian/maas-agent.postinst (+1/-3)
debian/maas-common.dirs (+0/-1)
debian/maas-dhcp.apparmor (+5/-5)
debian/maas-dhcp.maas-dhcpd.service (+2/-2)
debian/maas-dhcp.maas-dhcpd6.service (+2/-2)
debian/maas-dhcp.postinst (+0/-1)
debian/maas-dhcp.postrm (+1/-1)
debian/maas-proxy.dirs (+0/-1)
debian/maas-rack-controller.maas-rackd.service (+1/-0)
src/maasagent/cmd/maas-agent/main.go (+3/-3)
src/maasagent/cmd/maas-agent/main_test.go (+3/-3)
src/maasagent/internal/httpproxy/service.go (+1/-1)
- MAAS Lander: Approve
- Björn Tillenius: Approve
-
Diff: 234 lines (+19/-24)13 files modifieddebian/maas-agent.dirs (+0/-1)
debian/maas-agent.postinst (+1/-3)
debian/maas-common.dirs (+0/-1)
debian/maas-dhcp.apparmor (+5/-5)
debian/maas-dhcp.maas-dhcpd.service (+2/-2)
debian/maas-dhcp.maas-dhcpd6.service (+2/-2)
debian/maas-dhcp.postinst (+0/-1)
debian/maas-dhcp.postrm (+1/-1)
debian/maas-proxy.dirs (+0/-1)
debian/maas-rack-controller.maas-rackd.service (+1/-0)
src/maasagent/cmd/maas-agent/main.go (+3/-3)
src/maasagent/cmd/maas-agent/main_test.go (+3/-3)
src/maasagent/internal/httpproxy/service.go (+1/-1)
Changed in maas: | |
importance: | High → Critical |
Changed in maas: | |
assignee: | nobody → Jacopo Rota (r00ta) |
description: | updated |
Changed in maas: | |
milestone: | 3.5.0 → 3.6.0 |
Changed in maas: | |
importance: | Critical → High |
Changed in maas: | |
status: | Triaged → Fix Committed |
no longer affects: | maas/3.4 |
Looking at
ubuntu@ maas-deb35: /var/lib/ maas$ sudo systemctl status maas-dhcpd system/ maas-dhcpd. service; enabled; vendor preset: enabled) ists=/run/ maas/dhcp was not met
○ maas-dhcpd.service - MAAS instance of ISC DHCP server for IPv4
Loaded: loaded (/lib/systemd/
Active: inactive (dead)
Condition: start condition failed at Thu 2024-03-14 09:38:18 UTC; 92ms ago
└─ ConditionPathEx
Docs: man:dhcpd(8)
Mar 14 09:38:14 maas-deb35 systemd[1]: Condition check resulted in MAAS instance of ISC DHCP server for IPv4 being skipped. i-search) `up': sudo apt ^Cdate maas-deb35: /var/lib/ maas$ cat /lib/systemd/ system/ maas-dhcpd. service man:dhcpd( 8) online. target online. target sync.target maas-rackd. service ists=/run/ maas/dhcp ists=/var/ lib/maas/ dhcpd.conf ists=/var/ lib/maas/ dhcpd-interface s
Mar 14 09:38:14 maas-deb35 systemd[1]: Condition check resulted in MAAS instance of ISC DHCP server for IPv4 being skipped.
Mar 14 09:38:15 maas-deb35 systemd[1]: Condition check resulted in MAAS instance of ISC DHCP server for IPv4 being skipped.
Mar 14 09:38:15 maas-deb35 systemd[1]: Condition check resulted in MAAS instance of ISC DHCP server for IPv4 being skipped.
Mar 14 09:38:16 maas-deb35 systemd[1]: Condition check resulted in MAAS instance of ISC DHCP server for IPv4 being skipped.
Mar 14 09:38:16 maas-deb35 systemd[1]: Condition check resulted in MAAS instance of ISC DHCP server for IPv4 being skipped.
Mar 14 09:38:16 maas-deb35 systemd[1]: Condition check resulted in MAAS instance of ISC DHCP server for IPv4 being skipped.
Mar 14 09:38:17 maas-deb35 systemd[1]: Condition check resulted in MAAS instance of ISC DHCP server for IPv4 being skipped.
Mar 14 09:38:17 maas-deb35 systemd[1]: Condition check resulted in MAAS instance of ISC DHCP server for IPv4 being skipped.
Mar 14 09:38:18 maas-deb35 systemd[1]: Condition check resulted in MAAS instance of ISC DHCP server for IPv4 being skipped.
(reverse-
ubuntu@
[Unit]
Description=MAAS instance of ISC DHCP server for IPv4
Documentation=
Wants=network-
After=network-
After=time-
BindsTo=
ConditionPathEx
ConditionPathEx
ConditionPathEx
[Service] $(cat /var/lib/ maas/dhcpd- interfaces) ; \ FILE=/var/ lib/maas/ dhcp/dhcpd. leases; \ sbin/maas- dhcp-helper clean $LEASES_FILE; \ dhcp/dhcpd. pid \ maas/dhcpd. conf -lf $LEASES_FILE $INTERFACES'
# Allow dhcp server to write lease and pid file as 'dhcpd' user
# The leases files need to be root:dhcpd even when dropping privileges
ExecStart=/bin/sh -ec '\
INTERFACES=
LEASES_
[ -e $LEASES_FILE ] || touch $LEASES_FILE; \
/usr/
chown root:dhcpd /var/lib/maas/dhcp $LEASES_FILE; \
chmod 775 /var/lib/maas/dhcp ; chmod 664 $LEASES_FILE; \
exec dhcpd -user dhcpd -group dhcpd -f -q -4 -pf /run/maas/
-cf /var/lib/
# Require dhcpd stop in 8 seconds, if not kill it with 'mixed' mode.
TimeoutStopSec=8
KillMode=mixed
[Install] multi-user. target
WantedBy=
we can see that ConditionPathEx ists=/run/ maas/dhcp was not met . This is because we create /run/maas only when we install maas and after whatever reboot /run/maas goes away and we don't recreate it anymore (bug introduced here https:/ /github. com/maas/ maas/commit/ b402c32d0a85d26 fd6a5ce14a72056 013fd9...