new interface does not show up after dbus config apply
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Netplan |
Fix Released
|
Undecided
|
Lukas Märdian | ||
netplan.io (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Focal |
Fix Released
|
Undecided
|
Unassigned | ||
Hirsute |
Fix Released
|
Undecided
|
Unassigned | ||
Impish |
Fix Released
|
Undecided
|
Unassigned | ||
Jammy |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
[Impact]
snapd uses netplan's DBus API to create config objects and set/try/apply changed configuration.
There is a race condition in io.netplan.
[Test Plan]
In addition to running & passing the full set of unit- and integration-tests (that contains new tests to check for the cases described in this bug), as described in https:/
$path=$(dbus-send --system --print-reply --type=method_call --dest=
$ dbus-send --system --print-reply --type=method_call --dest=
$ dbus-send --system --print-reply --type=method_call --dest=
$ sleep 0.1
$ dbus-send --system --print-reply --type=method_call --dest=
$ ip link | grep br54
autopkgtest logs:
* Impish:
https:/
https:/
https:/
https:/
https:/
* Hirsute:
https:/
https:/
https:/
https:/
https:/
* Focal:
https:/
https:/
https:/
https:/
https:/
[Where problems could occur]
This upload contains changes to the netplan-dbus daemon and try+apply CLI of netplan, if anything goes wrong it could impact the interactive usage of 'netplan try/apply' by the user and the programmatic access to netplan's APIs via DBus.
[Other Info]
The full set of autopkgtest logs will be attached after the upload is accepted into -proposed and the tests have been run on the official autopkgtest.u.c
infrastructure.
=== Original Description ===
While working on the integration tests for netplan on ubuntu core I ran into the following issue:
1. the config system.
2. a subsequent "ip link" does not show this network interface
From the test log:
"""
...
+ 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.
+ echo 'Check that the interface is really there'
Check that the interface is really there
+ MATCH br54
+ ip link
grep error: pattern not found, got:
1: lo: <LOOPBACK,
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: ens3: <BROADCAST,
link/ether 52:54:00:12:34:56 brd ff:ff:ff:ff:ff:ff
"""
But when I ssh into this machine:
"""
qemu:ubuntu-
network:
bridges:
br54:
dhcp4: true
ethernets:
all-en:
dhcp4: true
match:
name: en*
all-eth:
dhcp4: true
match:
name: eth*
version: 2
"""
So the interfac is there but not applied.
What the go code is doing internally (using dbus) is:
1. clear config
2. set new config
3. call io.netplan.
4. check if store is still reachable
5. run io.netplan.
Log:
"""
Nov 04 18:35:56 ubuntu snapd[2864]: daemon.go:216: DEBUG: pid=3308;
Nov 04 18:35:56 ubuntu snapd[2864]: netplan.go:122: DEBUG: using netplan config /io/netplan/
Nov 04 18:35:57 ubuntu snapd[2864]: daemon.go:216: DEBUG: pid=3321;
Nov 04 18:35:57 ubuntu snapd[2864]: daemon.go:216: DEBUG: pid=3348;
Nov 04 18:35:57 ubuntu snapd[2864]: taskrunner.go:439: DEBUG: Running task 149 on Do: Run configure hook of "core" snap
Nov 04 18:35:57 ubuntu snapd[2864]: netplan.go:122: DEBUG: using netplan config /io/netplan/
Nov 04 18:35:57 ubuntu snapd[2864]: netplan.go:122: DEBUG: using netplan config /io/netplan/
Nov 04 18:35:57 ubuntu snapd[2864]: netplan.go:181: DEBUG: calling netplan.Set: network=null
Nov 04 18:35:57 ubuntu snapd[2864]: netplan.go:181: DEBUG: calling netplan.Set: network=
...
Nov 04 18:35:58 ubuntu snapd[2864]: netplan.go:229: DEBUG: netplan config applied correctly
"""
The originHint for all of these is "00-snapd-
But the interface does not appear.
But a subsequent:
""
qemu:ubuntu-
[notice that there is no output here? sorry, I was holding it wrong and filed https:/
qemu:ubuntu-
1: lo: <LOOPBACK,
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: ens3: <BROADCAST,
link/ether 52:54:00:12:34:56 brd ff:ff:ff:ff:ff:ff
3: br54: <BROADCAST,
link/ether 32:b4:1e:6a:73:ba brd ff:ff:ff:ff:ff:ff
"""
and the interface appears. Any hints welcome, this is netplan "0.103-
Any hints welcome :)
Details for how netplan dbus is driven can be found in https:/
description: | updated |
summary: |
- new interface does not show up after config apply + new interface does not show up after dbus config apply |
tags: | added: fr-1887 |
description: | updated |
Changed in netplan: | |
status: | In Progress → Fix Committed |
Changed in netplan: | |
status: | Fix Committed → Fix Released |
Maybe some sort of race between try and apply? The dbus calls will happen fairly quickly after each other if the store connection is quick.