Sometimes, Networkmanager fails to connect to wifi

When booting into Manjaro, Networkmanager sometimes fails to establish wifi connection. But it doesn’t happen ofen.

When it did happen, I tried to resolve it by rebooting again(sometimes this also fails) or killing the Networkmanager or running wpa_supplicant manually.

Has anybody experienced the same? What could be the cause?

I guess it has something to do with the initialization gap between the kernel module and the Networkmanager, for instance, the Networkmanager runs too fast but the kernel module reponsible for bringing up the net card is not fully ready yet.

Operating System: Manjaro Linux
KDE Plasma Version: 5.25.5
KDE Frameworks Version: 5.98.0
Qt Version: 5.15.6
Kernel Version: 5.19.16-2-MANJARO (64-bit)
Graphics Platform: X11
Processors: 8 × Intel® Core™ i5-8250U CPU @ 1.60GHz
Memory: 7.7 GiB of RAM
Graphics Processor: Mesa Intel® UHD Graphics 620

1 Like

That is a frequent problem i have on my legion laptop. It mainly happens when it gets out of sleep or hibernation. If i want to shut down or reboot, it infinitely pends and i have to force it.
I first found the following solution, enter in terminal :
systemctl restart NetworkManager.service

Then i dug a little bit deeper and found another thread talking about this exact issue (still looking for it sorry), and apparently the issue was that the networkmanager service was still trying to stop but couldn’t, and that froze the reboot/shutdown. The tldr was that entering the command line
systemctl cancel
in the terminal solved both wifi and reboot issues. Maybe either or both of these command lines can help?
Still looking for a way to make it stop completely or fix the bug that leads to this though…

Thanks for sharing.

Maybe the ultimate solution is to run wpa_supplicant in a simple script manually

for example, once I did this

/usr/sbin/wpa_supplicant -B -i wlp1s0 -c /etc/wifi.conf

# abtain ip address
dhcpcd wlp1s0

Taking into consideration that changing wifi is very often, automating this with a simple script.