netplan dbus returns "false" in io.netplan.Netplan.Config.Set with networkd
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Netplan |
Fix Released
|
Undecided
|
Unassigned | ||
netplan.io (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Focal |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
[Impact]
* netplan-dbus can time-out and return FALSE after 5 sec (irrespective of the given timeout parameter) on calling the io.netplan.
* This happens if a network device is set up, which never finishes configuring in systemd-networkd (e.g. an empty bridge, using DHCP).
[Test Plan]
$ cat ./repro.sh
set -ev
P=$(dbus-send --type=method_call --system --print-reply --dest=
echo $P
dbus-send --type=method_call --system --print-reply --dest=
dbus-send --type=method_call --system --print-reply --dest=
$ chmod +x repro.sh
$ time ./repro.sh
P=$(dbus-send --type=method_call --system --print-reply --dest=
echo $P
/io/netplan/
dbus-send --type=method_call --system --print-reply --dest=
method return time=1651225120
boolean true
dbus-send --type=method_call --system --print-reply --dest=
method return time=1651225126
boolean true
real 0m6.352s
user 0m0.019s
sys 0m0.020s
=> Make sure the final io.netplan.
[Where problems could occur]
This change touches netplan's dbus daemon (netplan-dbus), so if anything goes wrong problems could occur interacting with the io.netplan.Netplan DBus interface, but should not affect the netplan generator at a system level.
[Other Info]
* The issue has already been fixed for Core20 in netplan.io 0.104-0ubuntu2~
* The fix is already staged for Focal SRU at: https:/
=== Original 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:
-----
+ echo 'Getting version works'
Getting version works
+ snap get system system.
+ 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.
{
"system.
"network": {
"ethernets": {
"eth0": {
"dhcp4": true,
"match": {
},
}
},
"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.
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.
[edit: now this also fails in GCE testing on amd64 and this looks like a regression as this used to work].
description: | updated |
summary: |
- netplan dbus returns "false" in io.netplan.Netplan.Config.Set + netplan dbus returns "false" in io.netplan.Netplan.Config.Set with + networkd |
tags: | added: fr-2238 |
description: | updated |
We also observe this behavior now on UC20 systems that run with amd64, e.g. in this run: https:/ /github. com/snapcore/ snapd/runs/ 5876437750? check_suite_ focus=true
The log looks like this: 07T22:28: 41.1746417Z Apr 07 22:28:33 apr072148-447340 snapd[3454]: netplan.go:122: DEBUG: using netplan config snapshot /io/netplan/ Netplan/ config/ UY2RJ1 07T22:28: 41.1747073Z Apr 07 22:28:34 apr072148-447340 snapd[3454]: netplan.go:122: DEBUG: using netplan config snapshot /io/netplan/ Netplan/ config/ FKW9J1 07T22:28: 41.1747878Z Apr 07 22:28:34 apr072148-447340 snapd[3454]: retry.go:49: DEBUG: Retrying https:/ /api.snapcraft. io/v2/snaps/ info/core? architecture= amd64&fields= download, attempt 1, elapsed time=20.694µs 07T22:28: 41.1830683Z Apr 07 22:28:34 apr072148-447340 snapd[3454]: retry.go:61: DEBUG: The retry loop for https:/ /api.snapcraft. io/api/ v1/snaps/ download/ 99T7MUlRhtI3U0Q Fgl5mXXESAiSwt7 76_12834. snap finished after 1 retries, elapsed time=229.430054ms, status: 200 07T22:28: 41.1831580Z Apr 07 22:28:34 apr072148-447340 snapd[3454]: netplan.go:228: DEBUG: store reachable before netplan changes: true (tried 0 times) 07T22:28: 41.1832435Z Apr 07 22:28:40 apr072148-447340 snapd[3454]: task.go:343: DEBUG: 2022-04- 07T22:28: 40Z ERROR run hook "configure": cannot try netplan config: no specific reason returned from netplan
"""
2022-04-
2022-04-
2022-04-
...
2022-04-
2022-04-
2022-04-
"""