Rebuild Error - Failed to start Network Manager Wait Online

I’m getting an error massage, “Failed to start Network Manager Wait Online” whenever I try to do a rebuild switch or test. I’ve tried adding systemd.network.wait-online.enable = false, but still get the same error message. I’ve also tried reverting to an earlier version of my flake config, but I still get the same issue, so I feel like it has more to do with something I may have done to my system outside of my nixos rebuild/nixos configuration, though maybe I didn’t revert far enough.

My rebuild switch fails with the following message:

Job for NetworkManager-wait-online.service failed because the control process exited with error code.
See "systemctl status NetworkManager-wait-online.service" and "journalctl -xeu NetworkManager-wait-online.service" for details.
the following new units were started: nix-gc.timer, nix-optimise.timer, sysinit-reactivation.target, systemd-boot-random-seed.service, systemd-tmpfiles-resetup.service
warning: the following units failed: NetworkManager-wait-online.service

× NetworkManager-wait-online.service - Network Manager Wait Online
     Loaded: loaded (/etc/systemd/system/NetworkManager-wait-online.service; enabled; preset: enabled)
    Drop-In: /nix/store/rxxhydgmj6ps4bwird09306pjvh16bd4-system-units/NetworkManager-wait-online.service.d
             └─overrides.conf
     Active: failed (Result: exit-code) since Wed 2024-03-20 20:21:13 CDT; 49ms ago
   Duration: 1min 8.489s
       Docs: man:NetworkManager-wait-online.service(8)
    Process: 5569 ExecStart=/nix/store/9prndc4rizidz1igbsp2lwrsrx733j99-networkmanager-1.44.2/bin/nm-online -s -q (code=exited, status=1/FAILURE)
   Main PID: 5569 (code=exited, status=1/FAILURE)
         IP: 0B in, 0B out
        CPU: 30ms

Mar 20 20:20:13 nixos systemd[1]: Starting Network Manager Wait Online...
Mar 20 20:21:13 nixos systemd[1]: NetworkManager-wait-online.service: Main process exited, code=exited, status=1/FAILURE
Mar 20 20:21:13 nixos systemd[1]: NetworkManager-wait-online.service: Failed with result 'exit-code'.
Mar 20 20:21:13 nixos systemd[1]: Failed to start Network Manager Wait Online.

Here is the output to the journalctl command:

The output of the systemctl command is the same as the error message in the switch output.

Here is my flake: GitHub - dcolestock/nixos-flake

Any ideas what I’m doing wrong to cause this error?

1 Like

I eventually solved this by adding

systemd.network.wait-online.enable = false;
boot.initrd.systemd.network.wait-online.enable = false;

To my config, switching, rebooting (where I didn’t have any internet), then removing them from my config, switching and rebooting. Not sure which of those steps were required, for all I know it was just the couple of reboots that did it.

1 Like

Just for others who come here. I too had this issue, but in my case, I had an old bnridge that was no longer in use and was attempting to start, but would never be successful.

I noticed this when I ran nmcli device status and my br0 was stuck “connecting”… in my case I deleted it (knew I could as I had created it in the past for a manual libvirt network).

Then my error was fixed.

so nutshell, check the statuses on your devices.

3 Likes

Ran across the same thing after updating from 24.05 to unstable. The second reboot fixed it. I wouldn’t have thought to try just rebooting more than once if you hadn’t mentioned it so thanks for that. I’m betting that might be what fixed it for you too.

This issue used to be very common to run across if you were using Tailscale but that has since been worked around on unstable/24.11 and has been backported to 24.05 a week ago.

If you notice this in any other cases please report your configuration at NetworkManager's nm-online kills nixos-rebuild · Issue #180175 · NixOS/nixpkgs · GitHub

2 Likes