linuxmint / linuxmint

Linux Mint
75 stars 9 forks source link

Slow/delayed boot in Linux Mint22 due to NetworkManager.service #713

Closed commander-keen closed 1 month ago

commander-keen commented 2 months ago

After upgrading from Linux Mint 21.3 to v22 several users report a slow/delayed boot in Linux Mint22 due to NetworkManager.service:

systemd-analyze blame | head identifies NetworkManager.service as the culprit:

1min 1.609s NetworkManager.service
     5.639s NetworkManager-wait-online.service
     1.557s thermald.service
     1.281s docker.service
     1.042s accounts-daemon.service
     1.031s networking.service
      993ms upower.service
      934ms blueman-mechanism.service
      821ms avahi-daemon.service
      775ms systemd-rfkill.service

sudo systemd-analyze critical-chain:

The time when unit became active or started is printed after the "@" character.
The time the unit took to start is printed after the "+" character.

graphical.target @1min 11.852s
└─multi-user.target @1min 11.852s
  └─docker.service @1min 10.570s +1.281s
    └─network-online.target @1min 10.549s
      └─NetworkManager-wait-online.service @1min 4.905s +5.639s
        └─NetworkManager.service @3.291s +1min 1.609s
          └─dbus.service @2.450s +383ms
            └─basic.target @2.273s
              └─sockets.target @2.273s
                └─docker.socket @2.248s +24ms
                  └─sysinit.target @2.227s
                    └─systemd-backlight@leds:dell::kbd_backlight.service @4.163s +21ms
                      └─system-systemd\x2dbacklight.slice @4.067s
                        └─system.slice @347ms
                          └─-.slice @347ms

Everything was fine before the upgrade for years.

Don't know if the following warnings are anything to worry about / could be causing the slow boot time?

Aug 13 22:11:55 XPS NetworkManager[866]: <warn>  [1723579915.7834] dispatcher: (17) failed (after 0.006 sec): Transaction for NetworkManager-dispatcher.service/start is destructive (systemd-fsck@dev-disk-by\x2duuid-096D\x2d786F.service has 'stop' job queued, but 'start' is included in transaction).
Aug 13 22:13:27 XPS NetworkManager[769]: <warn>  [1723580007.3599] dns-mgr: update-pending changed: DNS plugin did not become ready again. Assume something is wrong
Aug 13 22:13:38 XPS NetworkManager[769]: <warn>  [1723580018.8747] device (wlp58s0): no secrets: No agents were available for this request.
Aug 13 22:13:38 XPS NetworkManager[769]: <warn>  [1723580018.8768] device (wlp58s0): Activation: failed for connection 'XXXX'

dns-mgr: update-pending changed: DNS plugin did not become ready again. Assume something is wrong. => Took more than a minute to detect this state(?) Maybe some systemd-resolved issue which I am absolutely not familiar with.

peter-stoll commented 2 months ago

I can confirm the behavior. An observation which might help, but which might just be by accident: I upgraded 2 computers from Mint 21.3 to Mint 22 . Both have from 99% the same configuration, as I do it automatically by ansible scripts, and both are within the same local network, connected by the same switch. The 1% are differences as only one is a laptop, the other one a ordinary (below-)desktop computer. But the way I installed Mint 22 was different. I observed:

Would be interesting to know how commander-keen did his upgrade, can you tell? If yes, this is a hint that mintupgrade might have an issue.

commander-keen commented 2 months ago

I was using the official mintupgrade tool also.

Are both of your computers using physically the same way to connect to the switch? (WiFi vs. ethernet cable?) As my Laptop has no ethernet port, I'm only on WiFi and could not test additionally via cable.

peter-stoll commented 2 months ago

Are both of your computers using physically the same way to connect to the switch? Yes, both connected by ethernet cable to the same switch. I did meanwhile a fresh install on my laptop (without mintupgrade tool), using exactly the same configuration, same network, and I have no issues anymore :-) .

DaasRam commented 2 months ago

Same issue here with fresh install , and I tested with kubuntu 24.04 and it also had the same problem .

Neaber commented 2 months ago

I had the same problem. After deleting all .yaml files except 1-network-manager-all.yaml in folder /etc/netplan the problem was solved for me.

godnroc commented 2 months ago

I had the same problem. After deleting all .yaml files except 1-network-manager-all.yaml in folder /etc/netplan the problem was solved for me.

This also appears to have fixed the issue for me. Great to shave 90 seconds off every boot!

commander-keen commented 2 months ago

This only helps for one next boot for me. As soon as I re-add the WiFi password afterwards (lost as a result of deleting the files), which also takes the 90s to get connected, every next boot is slow again.

commander-keen commented 2 months ago

The issue might be caused by this bug of netplan.io: https://bugs.launchpad.net/netplan/+bug/1999178 It was fixed for netplan.io v1.1, but I'm unsure if this version will come for the 24.04 base of Ubuntu underneath Linux Mint 22, because it is only listed as release for "oracular oriole". Maybe the proposed 1.0.1-1 for "noble numbat" also contains the fix. Then we would probably also get it through the repository. Otherwise it would be a pity...

godnroc commented 2 months ago

I just noticed that netplan.io 1.0.1-1ubuntu2~24.04.1 was in my update queue, did the update, and confirmed that my network settings no longer seem to be causing a delayed boot.

commander-keen commented 2 months ago

I just noticed that netplan.io 1.0.1-1ubuntu2~24.04.1 was in my update queue, did the update, and confirmed that my network settings no longer seem to be causing a delayed boot.

Still quite slow for me with netplan.io 1.0.1-1ubuntu2 (+16s), but indeed much much better (Should I consider ~16s as new normal or is it much faster for you than that?):

 sudo systemd-analyze critical-chain

The time when unit became active or started is printed after the "@" character.
The time the unit took to start is printed after the "+" character.

graphical.target @23.582s
└─multi-user.target @23.580s
  └─docker.service @21.907s +1.672s
    └─network-online.target @21.895s
      └─NetworkManager-wait-online.service @5.647s +16.247s
        └─NetworkManager.service @4.571s +1.062s
          └─dbus.service @2.457s +1.646s
            └─basic.target @2.238s
              └─sockets.target @2.237s
                └─docker.socket @2.195s +23ms
                  └─sysinit.target @2.178s
                    └─systemd-backlight@backlight:intel_backlight.service @4.66>
                      └─system-systemd\x2dbacklight.slice @4.543s
                        └─system.slice @380ms
                          └─-.slice @380ms