After a fresh Ubuntu 22.04.5 Desktop default installation, I changed the
apt sources to Noble, incl. apt-pinning for noble-proposed and executed
a "sudo apt dist-upgrade", that included the upgrade to network-
manager/noble-proposed 1.46.0-1ubuntu2.2.

lukas@lukas-Standard-PC-Q35-ICH9-2009:~$ apt list --upgradable | grep 
network-manager
[...]
network-manager/noble-proposed 1.46.0-1ubuntu2.2 amd64 [upgradable from: 
1.36.6-0ubuntu2]


The upgrade shows logs in the correct oder:
[...]
Setting up libnetplan1:amd64 (1.0.1-1ubuntu2~24.04.1) ...
[...]
Setting up netplan-generator (1.0.1-1ubuntu2~24.04.1) ...
Removing 'diversion of /lib/systemd/system-generators/netplan to 
/lib/systemd/system-generator
s/netplan.usr-is-merged by netplan-generator'
[...]
Setting up python3-netplan (1.0.1-1ubuntu2~24.04.1) ...
[...]
Setting up netplan.io (1.0.1-1ubuntu2~24.04.1) ...
[...]
Setting up network-manager (1.46.0-1ubuntu2.2) ...
Removing obsolete conffile /etc/NetworkManager/dispatcher.d/01-ifupdown ...
Migrating test123 (f4aef947-3b63-4470-a1f1-072590811f43) to /etc/netplan


No crash report was created during the upgrade, NetworkManager was successfully 
upgraded and Netplan can be used normally:

lukas@lukas-Standard-PC-Q35-ICH9-2009:~$ ls -la /var/crash/
total 8
drwxrwsrwt  2 root whoopsie 4096 Sep 11 16:21 .
drwxr-xr-x 14 root root     4096 Sep 11 16:24 ..
lukas@lukas-Standard-PC-Q35-ICH9-2009:~$ sudo netplan generate
lukas@lukas-Standard-PC-Q35-ICH9-2009:~$ echo $?
0
lukas@lukas-Standard-PC-Q35-ICH9-2009:~$ nmcli c
NAME                UUID                                  TYPE      DEVICE 
Wired connection 1  ff9cc172-1b0a-3638-8cf7-083086181e1f  ethernet  enp1s0 
lo                  d0a5f34b-acc6-475a-8911-5aac1a24ac4c  loopback  lo     
test123             f4aef947-3b63-4470-a1f1-072590811f43  ethernet  --  


PS: all the autopkgtest failures from comment #17 were resolved after
retry.

** Tags removed: verification-needed verification-needed-noble
** Tags added: verification-done verification-done-noble

-- 
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to network-manager in Ubuntu.
https://bugs.launchpad.net/bugs/2033259

Title:
  [SRU] NetworkManager triggers a call from (old) Netplan Python CLI
  into (old) libnetplan0 that got replaced by (new) libnetplan1 on dist-
  upgrade

Status in netplan.io package in Ubuntu:
  Won't Fix
Status in network-manager package in Ubuntu:
  Fix Released
Status in netplan.io source package in Jammy:
  New
Status in network-manager source package in Jammy:
  Invalid
Status in netplan.io source package in Noble:
  Won't Fix
Status in network-manager source package in Noble:
  Fix Committed
Status in netplan.io source package in Oracular:
  Won't Fix
Status in network-manager source package in Oracular:
  Fix Released

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/NetworkManager/sytem-connections/ profiles to 
/etc/netplan/ on package upgrade.
   * 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_cffi.cpython-310-x86_64-linux-gnu.so binary module, while 
python3-netplan on Noble++ ships a universal _netplan_cffi.abi3.so binary 
module. The old one can lead to issues when python3 is already upgraded.
   * Incompatible versions of Netplan CLI, Netplan Python bindings and 
libnetplan can lead to crashes of the Netplan CLI, like this: AttributeError: 
/lib/x86_64-linux-gnu/libnetplan.so.1: undefined symbol: 
netplan_get_id_from_nm_filename

   * 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_cffi.abi3.so), using dh-python & ${python3:Depends}
  substvars, and providing a stable libnetplan1 library.

  [ 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-7ubuntu0.22.04.4                
amd64        YAML network configuration abstraction runtime library
  ii  netplan.io                      0.106.1-7ubuntu0.22.04.4                
amd64        YAML network configuration abstraction for various backends

  root@jj-nm-np:~# sed -i 's/jammy/noble/g' /etc/apt/sources.list
  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-7ubuntu0.22.04.4                
amd64        YAML network configuration abstraction runtime library
  ii  libnetplan1:amd64               1.0.1-1ubuntu2~24.04.1                  
amd64        Declarative network configuration runtime library
  ii  netplan-generator               1.0.1-1ubuntu2~24.04.1                  
amd64        Declarative network configuration systemd-generator
  ii  netplan.io                      1.0.1-1ubuntu2~24.04.1                  
amd64        Declarative network configuration for various backends
  ii  python3-netplan                 1.0.1-1ubuntu2~24.04.1                  
amd64        Declarative network configuration Python bindings
  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-7ubuntu0.22.04.4                
amd64        YAML network configuration abstraction for various backends
  root@jj-nm-np:~# dpkg -l | grep netplan
  ii  libnetplan0:amd64               0.106.1-7ubuntu0.22.04.4                
amd64        YAML network configuration abstraction runtime library
  ii  libnetplan1:amd64               1.0.1-1ubuntu2~24.04.1                  
amd64        Declarative network configuration runtime library
  ii  netplan.io                      0.106.1-7ubuntu0.22.04.4                
amd64        YAML network configuration abstraction for various backends
  root@jj-nm-np:~# netplan generate
  Traceback (most recent call last):
    File "/usr/sbin/netplan", line 20, in <module>
      from netplan import Netplan
    File "/usr/share/netplan/netplan/__init__.py", line 18, in <module>
      from netplan.cli.core import Netplan
    File "/usr/share/netplan/netplan/cli/core.py", line 24, in <module>
      import netplan.cli.utils as utils
    File "/usr/share/netplan/netplan/cli/utils.py", line 27, in <module>
      import netplan.libnetplan as np
    File "/usr/share/netplan/netplan/libnetplan.py", line 54, in <module>
      lib.netplan_get_id_from_nm_filename.restype = ctypes.c_char_p
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/lib/python3.12/ctypes/__init__.py", line 392, in __getattr__
      func = self.__getitem__(name)
             ^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/lib/python3.12/ctypes/__init__.py", line 397, in __getitem__
      func = self._FuncPtr((name_or_ordinal, self))
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  AttributeError: /lib/x86_64-linux-gnu/libnetplan.so.1: undefined symbol: 
netplan_get_id_from_nm_filename

  [ 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/7350/8350)

  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/netplan/netplan.script
  ExecutableTimestamp: 1684343476
  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/sbin/netplan', 'generate']
  SourcePackage: netplan.io
  UserGroups: N/A

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/netplan.io/+bug/2033259/+subscriptions


-- 
Mailing list: https://launchpad.net/~desktop-packages
Post to     : desktop-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~desktop-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to