Autopkgtest fail of 1.0.1-2ubuntu3 - Activation failed because the device is unmanaged

Bug #1945596 reported by Christian Ehrhardt 
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
firewalld (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Hi,
while I unfortunately didn't find the time to work on it, at least I wanted to document the information I've got from various people as it will give anyone working on this a head start.

The test fails like:
/rhbz1773809.at:9: ip netns exec fwd-test-${at_group_normalized} sh <<-"HERE"
    { { { { nmcli connection up dummy0; echo $? >&3; } | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' | sed -e '/^[ \t]*$/d' | sed -e 's/[ \t]\+/ /g' | { printf "%s" "$(cat /dev/stdin)"; echo; } >&4; } 3>&1; } | { read RC; exit $RC; } } 4>&1
HERE

--- /dev/null 2021-09-07 17:29:45.592000000 +0000
+++ /tmp/testsuite.dir/at-groups/1/stderr 2021-09-07 17:30:19.138802912 +0000
@@ -0,0 +1 @@
+Error: Connection activation failed: Activation failed because the device is unmanaged
stdout:

/rhbz1773809.at:9: exit code was 4, expected 0
Connection 'dummy0' (f7940f13-0b5d-4a74-82e3-a68b9c65a50f) successfully deleted.
1. rhbz1773809.at:1: 1. NM overrides interface on reload (rhbz1773809.at:1): FAILED (rhbz1773809.at:9)

Example log:
https://autopkgtest.ubuntu.com/results/autopkgtest-impish/impish/amd64/f/firewalld/20210907_173449_632a0@/log.gz

While asking if anyone looked at it already Gianfranco had some context already:

<LocutusOfBorg> cpaelzer, please go ahead
<LocutusOfBorg> even upstream is not able to figure that one out
<LocutusOfBorg> its a new test iirc
<LocutusOfBorg> 1: NM overrides interface on reload FAILED (rhbz1773809.at:9)
<LocutusOfBorg> something related to network-manager default config
<LocutusOfBorg> and seems to be not failing in Debian
<LocutusOfBorg> cpaelzer, https://paste.ubuntu.com/p/9HC4M3x7cH/
<LocutusOfBorg> we are also not alone in that managed issue https://tracker.ceph.com/issues/45459

And a bit later it became clear that TJ has looked into it even a bit further:

<TJ-> cpaelzer: LocutusOfBorg: have you experimented with issuing the firewalld/NM rhbz1773809.at test manually? Unless I've for something really weird here, on 20.04 with linux=5.14/NM=1.22.10-1ubuntu2.2, the test doesn't do what it appears to do. That is, the nmcli commands executed in the netns DO NOT create the dummy interface in the netns, it is created in the HOST namespace. Verify with "ip
<TJ-> link show/ip netns exec $ns ip link show" after the "nmcli con add ..." command. The commands all succeed (in the parent namespace!) so maybe this test failure now is due to some change in namespace handling? See https://paste.ubuntu.com/p/8Vj59v9YBB/
<TJ-> cpaelzer: this looks like someone misunderstood things; running nmcli on the namespace doesn't seem to affect NetworkManager daemon running on the host. They communicate over Dbus. So unless nmcli is aware and passes its parent namespace it makes sense. So then the question is, why the change. Look at the NM source-code around the "Activation failed because the device is unmanaged" message -
<TJ-> it suggests some reasons/avenues for investigation (udev is one)

And later:

<LocutusOfBorg> TJ-, cpaelzer looking at the diff, the test previously was exporting some DBUS_SOCKET so maybe it was meant to communicate with the host?

Thanks to TJ and Gianfranco for all the work, all I managed to do on this so far is writing this up :-/

... tagging update-excuse

tags: added: update-excuse
description: updated
Revision history for this message
TJ (tj) wrote (last edit ):
Download full text (3.5 KiB)

Here's the reproducer that shows that dummy0 is being created in the host network namespace. This is an upstream bug (oversight) so far as I can tell from its purpose.

At the outset I should say this is not related to the actual cause of the autopkgtest failure - explanation of that at the end of this comment.

# what the host sees initially
root@t300chi:~# nmcli con
NAME UUID TYPE DEVICE
USB3hub 85f05002-c66a-4b03-b340-21f512ac72fd ethernet eth0
soggy b9e78bf8-9e6d-4292-9390-d56876fa8300 wifi wlp2s0
virbr0 b09a6211-605c-4d0c-bff7-996c5f58299c bridge virbr0

# add the new network namespace
root@t300chi:~# ip netns add test

# run nmcli in the network namespace
root@t300chi:~# ip netns exec test nmcli connection add type dummy con-name dummy0 ifname dummy0 ip4 10.0.0.2 gw4 10.0.0.1
Connection 'dummy0' (2bdfbb93-f51a-48d8-87f3-d2a2b5a72aee) successfully added.

# check if the interface has been added - strange, it lists dummy0 and the host interfaces!!
root@t300chi:~# ip netns exec test nmcli con
NAME UUID TYPE DEVICE
dummy0 2bdfbb93-f51a-48d8-87f3-d2a2b5a72aee dummy dummy0
USB3hub 85f05002-c66a-4b03-b340-21f512ac72fd ethernet eth0
soggy b9e78bf8-9e6d-4292-9390-d56876fa8300 wifi wlp2s0
virbr0 b09a6211-605c-4d0c-bff7-996c5f58299c bridge virbr0

# activate - note this succeeds on my system for a reason explained below
root@t300chi:~# ip netns exec test nmcli con up dummy0
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConn
ection/7)

# lets check what interfaces exist in the network namespace
root@t300chi:~# ip netns exec test ip link show
1: lo: <LOOPBACK> mtu 65536 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00

# aha! so dummy0 isn't in the namespace.

# interface is created on the parent network namespace where NetworkManager daemon is
oot@t300chi:~# nmcli con
NAME UUID TYPE DEVICE
dummy0 2bdfbb93-f51a-48d8-87f3-d2a2b5a72aee dummy dummy0
USB3hub 85f05002-c66a-4b03-b340-21f512ac72fd ethernet eth0
soggy b9e78bf8-9e6d-4292-9390-d56876fa8300 wifi wlp2s0
virbr0 b09a6211-605c-4d0c-bff7-996c5f58299c bridge virbr0

---

So the expectation that dummy0 is being created in the network namespace is incorrect. nmcli is talking to NetworkManager over DBus which is a daemon in the parent namespace.

Why is it failing on Ubuntu (but not on my system) ?

Due to my override of 10-globally-managed-devices.conf:

root@t300chi:~# ls -l /usr/lib/NetworkManager/conf.d/10-globally-managed-devices.conf /etc/NetworkManager/conf.d/

-rw-r--r-- 1 root root 80 Sep 27 16:07 /usr/lib/NetworkManager/conf.d/10-globally-managed-devices.conf

/etc/NetworkManager/conf.d/:
total 4
-rw-r--r-- 1 root root 0 Oct 31 04:48 10-globally-managed-devices.conf
-rw-r--r-- 1 root root 32 Sep 27 16:07 default-wifi-powersave-on.conf

root@t3...

Read more...

Revision history for this message
Dan Bungert (dbungert) wrote :

@TJ - you had this bug 99% figured out

Please see attached for what I have forwarded to upstream.
https://github.com/firewalld/firewalld/pull/880

As TJ mentions above, the test devices are being ignored.
Don't do that.

Dan Bungert (dbungert)
Changed in firewalld (Ubuntu):
status: New → Confirmed
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "firewalld-1_1.0.1-2ubuntu3_1.0.1-2ubuntu4.debdiff" seems to be a debdiff. The ubuntu-sponsors team has been subscribed to the bug report so that they can review and hopefully sponsor the debdiff. If the attachment isn't a patch, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are member of the ~ubuntu-sponsors, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issue please contact him.]

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

This bug was fixed in the package firewalld - 1.0.1-2ubuntu4

---------------
firewalld (1.0.1-2ubuntu4) jammy; urgency=medium

  * Fix autopkgtest failure on test rhbz1773809.at (LP: #1945596)
    - ensure the test devices are considered managed.

 -- Dan Bungert <email address hidden> Fri, 05 Nov 2021 15:36:35 -0600

Changed in firewalld (Ubuntu):
status: Confirmed → Fix Released
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.