Netplan generator causes systemd, apt and unlock hangs on 24.04

Bug #2069495 reported by Florian Hackenberger
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
netplan.io (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

From the issue in the netplan tracker [1]:

During a systemd daemon-reload, the Netplan generator in /usr/lib/systemd/system-generators/netplan tries to reload the udev rules and databases with udevadm control --reload [2], which causes a deadlock, because reloading udev rules and databases requires a functioning systemd-userdbd.service, which is not the case during a systemd daemon-reload. The systemd developers will not consider making changes to any systemd component in order to prevent this deadlock, and instead suggest that the Netplan developers generate their systemd link/network/netdev units using a generator service like systemd-network-generator.service.

[1] https://bugs.launchpad.net/netplan/+bug/1999178

On my machine, this causes every 'apt install' to be very slow, enabled / disabling systemd services to be slow, sudo hanging while these processes hang and so on.

ProblemType: Bug
DistroRelease: Ubuntu 24.04
Package: netplan-generator 1.0-2ubuntu1
ProcVersionSignature: Ubuntu 6.5.0-35.35-generic 6.5.13
Uname: Linux 6.5.0-35-generic x86_64
ApportVersion: 2.28.1-0ubuntu3
Architecture: amd64
CasperMD5CheckResult: pass
CurrentDesktop: GNOME
Date: Sat Jun 15 12:33:39 2024
InstallationDate: Installed on 2023-09-21 (268 days ago)
InstallationMedia: Ubuntu 23.04 "Lunar Lobster" - Release amd64 (20230417)
SourcePackage: netplan.io
UpgradeStatus: Upgraded to noble on 2024-05-28 (18 days ago)

Revision history for this message
Florian Hackenberger (f-hackenberger) wrote :
Revision history for this message
Florian Hackenberger (f-hackenberger) wrote :

Oh fixing this also solved 60 seconds+ hangs when unlocking my desktop after resuming from suspend.

summary: - Netplan generator causes systemd and apt hangs on 24.04
+ Netplan generator causes systemd, apt and unlock hangs on 24.04
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
Ilya Loginov (isloginov) wrote (last edit ):

I tried to investigate the problem with long boot for several days. Even tried to reinstall system.

Only after enabling debug logs in systemd I found out that it was `/usr/lib/systemd/system-generators/netplan`. systemd-analyze told it was NetworkManager.

So I removed link `/usr/lib/systemd/system-generators/netplan` and my boot time reduced for almost 2mins.

There was nothing interesting in `/etc/netplan/01-network-manager-all.yaml` (with 0400 access rights, that was strange):
```
network:
  version: 2
  renderer: NetworkManager
```

Revision history for this message
Martin Damzog (thessalonians) wrote :

I can reproduce this bug by typing 'sudo netplan --debug generate' in the shell. This netplan command takes about 1 min to complete. On sound systems, it will only take one second. Deleting the link – as described by Ilya – solves the problem.

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

Thanks for reporting this issue! I'm marking this as a duplicate of bug #1999178

Let's try to keep the discussion in one place.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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