[SRU] NetworkManager triggers a call from (old) Netplan Python CLI into (old) libnetplan0 that got replaced by (new) libnetplan1 on dist-upgrade
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
netplan.io (Ubuntu) |
Won't Fix
|
Medium
|
Unassigned | ||
Jammy |
New
|
Undecided
|
Unassigned | ||
Noble |
Won't Fix
|
Medium
|
Unassigned | ||
Oracular |
Won't Fix
|
Medium
|
Unassigned | ||
network-manager (Ubuntu) |
Fix Released
|
Medium
|
Unassigned | ||
Jammy |
Invalid
|
Undecided
|
Unassigned | ||
Noble |
Fix Committed
|
Medium
|
Unassigned | ||
Oracular |
Fix Released
|
Medium
|
Unassigned |
Bug Description
[ Impact ]
* Context: Running a dist-upgrade from Jammy to Noble.
* Starting with Noble (Mantic actually), NetworkManager integrates with Netplan as a backend and calls 'netplan generate' at different stages, e.g. when migrating old /etc/NetworkMan
* NetworkManager depends on Netplan >= 0.106 only, but there was a major SOVER/ABI bump of libnetplan, starting with Netplan v1.0. The new build-dependency on libnetplan1 >= 1.0 is automatically picked up, but the runtime dependency on the Netplan CLI (netplan.io binary) is not.
* Therefore, we can end up in a situation where the old netplan.io Python CLI is still installed during dist-upgrade and tries to call into the new libnetplan1, which is incompatible.
* Furthermore, python3-netplan ships a python3.10 specific _netplan_
* Incompatible versions of Netplan CLI, Netplan Python bindings and libnetplan can lead to crashes of the Netplan CLI, like this: AttributeError: /lib/x86_
* Such crash doesn't always happen, as it depends on the ordering of package upgrades during dist-upgrade. It will recover itself after the dist-upgrade is complete and all components are at their expected versions again. So side-effects are rather small, but it can lead to blocking of phased-updates for Netplan, which we'd like to avoid (LP: #2058031).
* We want to make sure NetworkManager pulls in the latest libnetplan1, netplan.io and python3-netplan packages on dist-upgrade, to avoid such issues. Therefore declaring corresponding dependencies on the network-manager binary package in debian/control. Such changes are not needed on series after Noble, as recent Netplan is much more resilient against such issues, using a python stable API binary module (_netplan_
[ Test Plan ]
$ lxc launch ubuntu-daily:jammy jj-nm-np
$ lxc shell jj-nm-np
# Verify old version of Netplan (< 1.0)
root@jj-nm-np:~# dpkg -l | grep netplan
ii libnetplan0:amd64 0.106.1-
ii netplan.io 0.106.1-
root@jj-nm-np:~# sed -i 's/jammy/noble/g' /etc/apt/
root@jj-nm-np:~# apt update
root@jj-nm-np:~# apt install network-manager
=> Make sure libnetplan1 >= 1.0, netplan.io >= 1.0 and python3-netplan >= 1.0 are installed and the Netplan CLI does not crash, e.g.:
root@jj-nm-np:~# dpkg -l | grep netplan
ii libnetplan0:amd64 0.106.1-
ii libnetplan1:amd64 1.0.1-1ubuntu2~
ii netplan-generator 1.0.1-1ubuntu2~
ii netplan.io 1.0.1-1ubuntu2~
ii python3-netplan 1.0.1-1ubuntu2~
root@jj-nm-np:~# netplan generate
root@jj-nm-np:~# echo $?
0
On a broken system, it looks like this:
root@jj-nm-np:~# dpkg -l | grep netplan.io
ii netplan.io 0.106.1-
root@jj-nm-np:~# dpkg -l | grep netplan
ii libnetplan0:amd64 0.106.1-
ii libnetplan1:amd64 1.0.1-1ubuntu2~
ii netplan.io 0.106.1-
root@jj-nm-np:~# netplan generate
Traceback (most recent call last):
File "/usr/sbin/
from netplan import Netplan
File "/usr/share/
from netplan.cli.core import Netplan
File "/usr/share/
import netplan.cli.utils as utils
File "/usr/share/
import netplan.libnetplan as np
File "/usr/share/
lib.
^^^
File "/usr/lib/
func = self.__
File "/usr/lib/
func = self._FuncPtr(
AttributeError: /lib/x86_
[ Test Plan 2 ]
* In addition to the specific test plan above, we want to run a full dist-upgrade of an Ubuntu Jammy Desktop VM to a Ubuntu Noble system (noble-proposed, to test the actual SRU candidate package). Making sure the upgrade still passes.
[ Where problems could occur ]
* We're modifying the runtime dependencies of NetworkManager, making it more strict wrt. the Netplan system packages. This will lead to different dependency resolving during apt dist-upgrade and could lead to unresolvable dependency loops. We introduced "Test Plan 2" above to check for that.
[ Other Info ]
* The dependency on python3-netplan >= 1.0 isn't there in Oracular+ (only netplan.io >= 1.0). It's not needed, because the effects will only surface on dist-upgrade from libnetplan0 to libnetplan1 and libnetplan0 doesn't exist anymore as of Noble (Netplan 1.0).
=== Original bug report ===
ubuntu desktop (mantic) live test on dell optiplex 780
- dell [optiplex] 780 (c2q-q9400, 8gb, amd/ati cedar radeon hd 5000/6000/
exploring the /var/crash/ directory I noticed this report; nothing had appeared on screen, so just filed it with `ubuntu-bug`.
ProblemType: Crash
DistroRelease: Ubuntu 23.10
Package: netplan.io 0.106.1-8
Uname: Linux 6.3.0-7-generic x86_64
Architecture: amd64
Date: Mon Aug 28 08:12:32 2023
ExecutablePath: /usr/share/
ExecutableTimes
InterpreterPath: /usr/bin/python3.11
ProcCmdline: /usr/bin/python3 /usr/sbin/netplan generate
ProcCwd: /
ProcEnviron:
LANG=en_US.UTF-8
PATH=(custom, no user)
PythonArgs: ['/usr/
SourcePackage: netplan.io
UserGroups: N/A
tags: | removed: need-duplicate-check |
Changed in netplan.io (Ubuntu): | |
importance: | Undecided → Medium |
description: | updated |
tags: | added: foundations-todo |
Changed in network-manager (Ubuntu Oracular): | |
status: | New → Triaged |
importance: | Undecided → Medium |
tags: | added: sru-next |
Changed in network-manager (Ubuntu Noble): | |
importance: | Undecided → Medium |
status: | Confirmed → Triaged |
status: | Triaged → Confirmed |
Changed in netplan.io (Ubuntu Noble): | |
importance: | Undecided → Medium |
status: | Confirmed → Triaged |
description: | updated |
description: | updated |
Changed in network-manager (Ubuntu Noble): | |
status: | Confirmed → In Progress |
This bug has been reported on the Ubuntu ISO testing tracker.
A list of all reports related to this bug can be found here: /iso.qa. ubuntu. com/qatracker/ reports/ bugs/2033259
https:/