netplan crashes on UbuntuCore with the network-manager snap installed
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
netplan |
Fix Released
|
Undecided
|
Lukas Märdian | ||
netplan.io (Ubuntu) |
Fix Released
|
High
|
Unassigned | ||
Focal |
In Progress
|
Undecided
|
Unassigned | ||
Jammy |
Won't Fix
|
Undecided
|
Unassigned | ||
Kinetic |
Invalid
|
Undecided
|
Unassigned | ||
Lunar |
Fix Released
|
High
|
Unassigned |
Bug Description
[ Impact ]
* When using the netplan-dbus API on Ubuntu Core and the network-manager renderer (NM snap) the "netplan-dbus" application will crash. Leaving the device unreachable.
* Netplan's CLI is unable to find the network-
[ Test Plan ]
=======
Boot an Ubuntu Core 20 system, which this fix as part of the core20 base snap
=======
$ snap install network-manager --channel=20/stable
$ nmcli # VERIFY br54 is not there
ens3: connected to netplan-ens3
"ens3"
ethernet (virtio_net), 52:54:00:12:34:56, hw, mtu 1500
ip4 default
inet4 10.0.2.15/24
route4 0.0.0.0/0
route4 10.0.2.0/24
inet6 fe80::5054:
route6 fe80::/64
lo: unmanaged
"lo"
loopback (unknown), 00:00:00:00:00:00, sw, mtu 65536
DNS configuration:
servers: 10.0.2.3
interface: ens3
$ sudo snap set system system.
=======
Network/SSH connection will be interrupted briefly, but reconnect after some seconds.
=======
$ netplan get # VERIFY br54 is there
network:
version: 2
renderer: NetworkManager
ethernets:
ens3:
dhcp4: true
bridges:
br54:
dhcp4: true
$ sudo journalctl | grep FileNotFound # EMPTY => no errors
$ nmcli # VERIFY br54 is there
ens3: connected to netplan-ens3
"ens3"
ethernet (virtio_net), 52:54:00:12:34:56, hw, mtu 1500
ip4 default, ip6 default
inet4 10.0.2.15/24
route4 0.0.0.0/0
route4 10.0.2.0/24
inet6 fec0::5054:
inet6 fe80::5054:
route6 fe80::/64
route6 ::/0
route6 fec0::/64
br54: connecting (getting IP configuration) to netplan-br54
"br54"
bridge, 12:E6:74:FA:8A:75, sw, mtu 1500
lo: unmanaged
"lo"
loopback (unknown), 00:00:00:00:00:00, sw, mtu 65536
DNS configuration:
servers: 10.0.2.3
interface: ens3
[ Test Plan 2 "Classic" ]
# Prepare environment with NetworkManager installed and the 'nmcli' binary moved to /snap/bin/nmcli (outside of PATH and outside of Python's default/fallback BINDIR).
$ apt install network-manager
$ mv /usr/bin/nmcli /snap/bin/nmcli
$ netplan get
network:
version: 2
ethernets:
eth0:
dhcp4: true
$ netplan set network.
$ netplan set network.
$ netplan get
network:
version: 2
renderer: NetworkManager
ethernets:
eth0:
dhcp4: true
bridges:
br54:
addresses:
- "10.0.0.20/24"
$ env -u PATH /usr/sbin/netplan try # Try-Apply the configuration
=> This should NOT crash!
=> Check that the "netplan-br54" connection is "connected" and the "br54" got created correctly with IP address 10.0.0.20/24:
$ /snap/bin/nmcli d show br54
GENERAL.DEVICE: br54
GENERAL.TYPE: bridge
GENERAL.HWADDR: 6E:70:F7:76:39:67
GENERAL.MTU: 1500
GENERAL.STATE: 100 (connected)
GENERAL.CONNECTION: netplan-br54
GENERAL.CON-PATH: /org/freedeskto
IP4.ADDRESS[1]: 10.0.0.20/24
IP4.GATEWAY: --
IP4.ROUTE[1]: dst = 10.0.0.0/24, nh = 0.0.0.0, mt = 425
$ ip addr show br54
5: br54: <NO-CARRIER,
link/ether 6e:70:f7:76:39:67 brd ff:ff:ff:ff:ff:ff
inet 10.0.0.20/24 brd 10.0.0.255 scope global noprefixroute br54
valid_lft forever preferred_lft forever
# Running a similar test through 'netplan-dbus'
$ killall netplan-dbus
$ env -u PATH /usr/lib/
$ busctl call io.netplan.Netplan /io/netplan/Netplan io.netplan.Netplan Config
o "/io/netplan/
$ busctl call io.netplan.Netplan /io/netplan/
b true
$ busctl call io.netplan.Netplan /io/netplan/
b true
=> Make sure the 'netplan-dbus' binary did not crash.
[ Where problems could occur ]
* Netplan is a core component, thus changing it bears a high risk
* This upload modifies Netplan's CLI only, therefor the system boot-up and initial network connection should not be affect if anything goes wrong.
* Netplan's CLI could be affected, breaking the snapd integration (dbus-netplan) and CLI commands like "netplan apply"
[ Other Info ]
* This is addressed in Jammy via bug #2025519 (SRU/backport of 0.106.1)
* This has been fixed upstream in https:/
* A test PPA is available here: https:/
=== original bug report ===
When using the netplan-dbus API on Ubuntu Core and the network-manager renderer the "netplan-dbus" appication will crash. To reproduce take a UC20 or UC22 system and run:
```
$ sudo snap set system system.
```
(which in effect just drives the dbus API of netplan).
After that the network is lost. When manually restarting it the error is:
```
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 and cannot cancel netplan config: Unknown object '/io/netplan/
```
and the journal reports:
```
Jan 31 10:46:04 ubuntu sudo[1746]: mvo : TTY=pts/0 ; PWD=/home/mvo ; USER=root ; COMMAND=
Jan 31 10:46:04 ubuntu sudo[1746]: pam_unix(
Jan 31 10:46:05 ubuntu io.netplan.
Jan 31 10:46:05 ubuntu io.netplan.
Jan 31 10:46:05 ubuntu io.netplan.
Jan 31 10:46:05 ubuntu io.netplan.
Jan 31 10:46:05 ubuntu io.netplan.
Jan 31 10:46:05 ubuntu io.netplan.
Jan 31 10:46:05 ubuntu io.netplan.
Jan 31 10:46:05 ubuntu io.netplan.
Jan 31 10:46:05 ubuntu io.netplan.
Jan 31 10:46:05 ubuntu io.netplan.
Jan 31 10:46:05 ubuntu io.netplan.
Jan 31 10:46:05 ubuntu io.netplan.
Jan 31 10:46:05 ubuntu io.netplan.
Jan 31 10:46:05 ubuntu io.netplan.
Jan 31 10:46:05 ubuntu io.netplan.
Jan 31 10:46:05 ubuntu io.netplan.
Jan 31 10:46:05 ubuntu io.netplan.
Jan 31 10:46:05 ubuntu io.netplan.
Jan 31 10:46:05 ubuntu io.netplan.
Jan 31 10:46:05 ubuntu io.netplan.
Jan 31 10:46:05 ubuntu io.netplan.
Jan 31 10:46:05 ubuntu io.netplan.
Jan 31 10:46:05 ubuntu io.netplan.
Jan 31 10:46:05 ubuntu io.netplan.
Jan 31 10:46:05 ubuntu io.netplan.
Jan 31 10:46:05 ubuntu io.netplan.
Jan 31 10:46:05 ubuntu io.netplan.
Jan 31 10:46:05 ubuntu io.netplan.
Jan 31 10:46:05 ubuntu io.netplan.
Jan 31 10:46:05 ubuntu io.netplan.
Jan 31 10:46:05 ubuntu io.netplan.
Jan 31 10:46:05 ubuntu io.netplan.
Jan 31 10:46:05 ubuntu io.netplan.
Jan 31 10:46:05 ubuntu io.netplan.
Jan 31 10:46:05 ubuntu io.netplan.
Jan 31 10:46:05 ubuntu io.netplan.
Jan 31 10:46:05 ubuntu io.netplan.
Jan 31 10:46:05 ubuntu io.netplan.
Jan 31 10:46:05 ubuntu io.netplan.
Jan 31 10:46:05 ubuntu io.netplan.
Jan 31 10:46:05 ubuntu io.netplan.
Jan 31 10:46:10 ubuntu io.netplan.
Jan 31 10:46:10 ubuntu snapd[605]: taskrunner.go:271: [change 13 "Run configure hook of \"core\" snap" task] failed: run hook "configure": cannot try netplan config: no specific reason returned from netplan and cannot cancel netplan config: Unknown object '/io/netplan/
```
The full journal log is attached.
I guess it's a bit the question if this is a netplan or a nm-snap bug (it might need to provide an nmcli alias?). But in any case the crash and losing network is worth fixing regardless I think.
Fwiw, I also suspect this is the issue that prevents my spread tests in https:/
Changed in netplan: | |
status: | In Progress → Fix Committed |
Changed in netplan: | |
status: | Fix Committed → Fix Released |
tags: | added: sru-next |
tags: | added: foundations-todo |
description: | updated |
description: | updated |
description: | updated |
description: | updated |
description: | updated |
description: | updated |
FTR, there is an alias registered in the store for network- mananger. nmcli