[Bug 1967084] Re: netplan dbus returns "false" in io.netplan.Netplan.Config.Set with networkd
Lukas Märdian
1967084 at bugs.launchpad.net
Thu Apr 28 14:37:41 UTC 2022
Phew... looks like we have plenty of layered problems here:
1) calling "netplan set network.bridges.br54.dhcp4=true" will create an
empty bridge that will never get its DHCP4 configuration, thus will stay
stuck in the "configuring" state of "networkctl". Having empty bridges
is not really a production setup, and for test suites a simple
workaround would be to define "dhcp4=false" instead, thus it will not
trigger this problem.
2) networkctl reload/reconfigure is not super mature in Focal/systemd
v245 yet and there are some races that happen when netplan calls
"networkctl reload && networkctl reconfigure" right after each other
during its "netplan apply" call. I started going down this rabbit hole,
patching systemd-networkd, but this just leads to more problems. IMO we
should not heavily patch systemd-networkd, as long as it works "good
enough". (It works correctly on newer versions of systemd)
3) netplan-dbus does not apply the user's timeout parameter while
waiting for 'netplan try' to execute. this should be fixed by this
upstream PR: https://github.com/canonical/netplan/pull/271
4) The distro patch applied to the Focal package
(https://git.launchpad.net/ubuntu/+source/netplan.io/tree/debian/patches/0006-cli-
apply-give-some-extra-time-for-networkctl-
reload.patch?h=applied/ubuntu/focal-updates) implements a 5 second
timeout (due to the networkctl reload/reconfigure race-condition,
mentioned in (2)) that is in conflict with the 5 seconds timeout in
netplan-dbus (from (3)). This only applies to Focal.
So my proposal to fix this is:
- change the test-suite to call 'netplan set bridges.br54.dhcp4=false'
- The upstream patch from PR#271 was already applied to the netplan packaging for Core20, and should be included with the next Focal SRU (and potentially the other series, too – but with less urgency, as the conflicting distro patch is not in place there).
TL;DR: The root cause is a distro patch that was included in Focal, but we need this patch to work around systemd-networkd race conditions in systemd v245, so should implement other means to avoid this issue in Focal. This issue does not affect newer series of Ubuntu, due to improved systemd-networkd.
** Changed in: netplan
Status: New => Fix Committed
** Also affects: netplan.io (Ubuntu Focal)
Importance: Undecided
Status: New
** Changed in: netplan.io (Ubuntu)
Status: New => Fix Released
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to netplan.io in Ubuntu.
Matching subscriptions: foundations-bugs
https://bugs.launchpad.net/bugs/1967084
Title:
netplan dbus returns "false" in io.netplan.Netplan.Config.Set with
networkd
Status in netplan:
Fix Committed
Status in netplan.io package in Ubuntu:
Fix Released
Status in netplan.io source package in Focal:
New
Bug description:
As part of our snapd core integration testing we run the spread test
for netplan on a UC20 PI device.
On this device our test fails with:
"""
2022-03-25 14:33:00 Error executing external:ubuntu-core-20-arm-32:tests/core/netplan-cfg (external:ubuntu-core-20-arm-32) :
-----
+ echo 'Getting version works'
Getting version works
+ snap get system system.network.netplan.network.version
+ MATCH '^2$'
+ echo 'Getting the full document works and it is valid json'
Getting the full document works and it is valid json
+ jq .
+ snap get -d system system.network.netplan
{
"system.network.netplan": {
"network": {
"ethernets": {
"eth0": {
"dhcp4": true,
"match": {
"macaddress": "b8:27:eb:41:42:43"
},
"set-name": "eth0"
}
},
"version": 2
}
}
}
+ echo 'Check that setting adding a br54 interface via netplan works'
Check that setting adding a br54 interface via netplan works
+ snap set system system.network.netplan.network.bridges.br54.dhcp4=true
error: cannot perform the following tasks:
- Run configure hook of "core" snap (run hook "configure": cannot try netplan config: no specific reason returned from netplan)
-----
"""
This error means that snapd called io.netplan.Netplan.Config.Set and
got a "false" without an error from that call (c.f.
https://github.com/snapcore/snapd/blob/master/overlord/configstate/configcore/netplan.go#L218)
[edit: now this also fails in GCE testing on amd64 and this looks like a regression as this used to work].
To manage notifications about this bug go to:
https://bugs.launchpad.net/netplan/+bug/1967084/+subscriptions
More information about the foundations-bugs
mailing list