netplan.script crashed with AttributeError in __getitem__(): /usr/bin/python3: undefined symbol: netplan_get_id_from_nm_filename

Bug #2033259 reported by Chris Guiver
28
This bug affects 3 people
Affects Status Importance Assigned to Milestone
netplan.io (Ubuntu)
Status tracked in Oracular
Noble
Confirmed
Undecided
Unassigned
Oracular
Confirmed
Medium
Unassigned
network-manager (Ubuntu)
Status tracked in Oracular
Noble
New
Undecided
Unassigned
Oracular
Triaged
Medium
Unassigned

Bug Description

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

Revision history for this message
Chris Guiver (guiverc) wrote :
information type: Private → Public
tags: removed: need-duplicate-check
Changed in netplan.io (Ubuntu):
importance: Undecided → Medium
Chris Guiver (guiverc)
description: updated
Revision history for this message
Ubuntu QA Website (ubuntuqa) wrote :

This bug has been reported on the Ubuntu ISO testing tracker.

A list of all reports related to this bug can be found here:
https://iso.qa.ubuntu.com/qatracker/reports/bugs/2033259

tags: added: iso-testing
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in netplan.io (Ubuntu):
status: New → Confirmed
Revision history for this message
Lukas Märdian (slyon) wrote :

I wonder if we can reproduce this issue on 0.107, which is now in Mantic?

The /usr/share/netplan/netplan/libnetplan.py file (where the crash happens) is not part of the new 0.107 release anymore. And the new CFFI bindings will not allow compilation if the symbol would be missing.

Revision history for this message
Lukas Märdian (slyon) wrote :

It might be NetworkManager (or cloud-init) calling "netplan generate" during an upgrade/installation of packages, when libnetplan is already upgraded to >= v1.0 (libnetplan1), while netplan.io (the Python bits) are still on the old version (v0.106/v0.107)...

Revision history for this message
Lukas Märdian (slyon) wrote :
Download full text (5.8 KiB)

Unsing a Jammy system and installing libnetplan1 from Noble leads to this issue. When network-manager is installed in that context, it also triggers the crash:

root@jj-nn-np-nm-crash:~# 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-nn-np-nm-crash:~# 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.10/ctypes/__init__.py", line 387, in __getattr__
    func = self.__getitem__(name)
  File "/usr/lib/python3.10/ctypes/__init__.py", line 392, 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

root@jj-nn-np-nm-crash:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.4 LTS
Release: 22.04
Codename: jammy

root@jj-nn-np-nm-crash:~# ll /var/crash/_usr_share_netplan_netplan.script.0.crash
-rw-r----- 1 root root 31274 Sep 12 14:37 /var/crash/_usr_share_netplan_netplan.script.0.crash

The installation of "network-manager" succeeds, but the crash can then be observed.

root@jj-nn-np-nm-crash:~# apt install network-manager
[...]
root@jj-nn-np-nm-crash:~# systemctl status NetworkManager
● NetworkManager.service - Network Manager
     Loaded: loaded (/lib/systemd/system/NetworkManager.service; enabled; vendor preset: enabled)
     Active: active (running) since Thu 2024-09-12 14:38:17 UTC; 1min 50s ago
       Docs: man:NetworkManager(8)
   Main PID: 4993 (NetworkManager)
      Tasks: 4 (limit: 28393)
     Memory: 3.0M
        CPU: 444ms
     CGroup: /system.slice/NetworkManager.service
             └─4993 /usr/sbin/NetworkManager --no-daemon

Sep 12 14:38:17 jj-nn-np-nm-crash NetworkManager[5021]: lib.netplan_get_id_from_nm_filename.restype = ctypes.c_char_p
Sep 12 14:38:17 jj-nn-np-nm-crash NetworkManager[5021]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Sep 12 14:38:17 jj-nn-np-nm-crash NetworkManager[5021]: File "/usr/lib/python3.12/ctypes/__init__.py", line 392, in __getattr__
Sep 12 14:38:17 jj-nn-np-nm-crash NetworkManager[5021]: func = self.__getitem__(name)
Sep 12 14:38:17 jj-nn-np-nm-crash NetworkManager[5021]: ^^^^^^^^^^^^^^^^^^^^^^
Sep 12 14:38:17 jj-nn-np-nm-crash NetworkManager[5021]: File...

Read more...

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in netplan.io (Ubuntu Noble):
status: New → Confirmed
Lukas Märdian (slyon)
tags: added: foundations-todo
Changed in network-manager (Ubuntu Oracular):
status: New → Triaged
importance: Undecided → Medium
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.