network-manager does not autoconnect to wifi network after resume from suspend

Bug #1448555 reported by Wolf Rogner
162
This bug affects 34 people
Affects Status Importance Assigned to Milestone
network-manager (Ubuntu)
Confirmed
Medium
Unassigned

Bug Description

After upgrading to 15.04 network manager does not reconnect to the wifi network after resuming from a suspend to memory.

Workaround:
disable and re-enable wireless network -> connects immediately

ProblemType: Bug
DistroRelease: Ubuntu 15.04
Package: network-manager 0.9.10.0-4ubuntu15
ProcVersionSignature: Ubuntu 3.19.0-15.15-generic 3.19.3
Uname: Linux 3.19.0-15-generic x86_64
NonfreeKernelModules: nvidia wl
ApportVersion: 2.17.2-0ubuntu1
Architecture: amd64
CurrentDesktop: Unity
Date: Sat Apr 25 23:53:54 2015
IfupdownConfig:
 # interfaces(5) file used by ifup(8) and ifdown(8)
 auto lo
 iface lo inet loopback
InstallationDate: Installed on 2013-05-17 (708 days ago)
InstallationMedia: Ubuntu 13.04 "Raring Ringtail" - Release amd64+mac (20130424)
IpRoute:
 default via 10.1.0.254 dev wlan0 proto static metric 1024
 10.0.0.0/8 dev wlan0 proto kernel scope link src 10.1.0.103
 169.254.0.0/16 dev wlan0 scope link metric 1000
NetworkManager.state:
 [main]
 NetworkingEnabled=true
 WirelessEnabled=true
 WWANEnabled=true
 WimaxEnabled=true
SourcePackage: network-manager
UpgradeStatus: Upgraded to vivid on 2015-04-25 (0 days ago)
nmcli-dev:
 DEVICE TYPE STATE DBUS-PATH CONNECTION CON-UUID CON-PATH
 wlan0 wifi connected /org/freedesktop/NetworkManager/Devices/1 rsb_hs d8793959-2da1-4dc6-85ad-2dcf9e36e64b /org/freedesktop/NetworkManager/ActiveConnection/1
 EC:88:92:61:E9:5F bt disconnected /org/freedesktop/NetworkManager/Devices/2 -- -- --
 lo loopback unmanaged /org/freedesktop/NetworkManager/Devices/0 -- -- --
nmcli-nm: Error: command ['nmcli', '-f', 'all', 'nm'] failed with exit code 2: Error: Object 'nm' is unknown, try 'nmcli help'.

Revision history for this message
Wolf Rogner (war-rsb) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in network-manager (Ubuntu):
status: New → Confirmed
Revision history for this message
Wolf Rogner (war-rsb) wrote :

Just found this in /var/log/pm-suspend.log:

Running hook /usr/lib/pm-utils/sleep.d/60_wpa_supplicant suspend suspend:
Failed to connect to non-global ctrl_ifname: (null) error: No such file or directory
/usr/lib/pm-utils/sleep.d/60_wpa_supplicant suspend suspend: success.

full log attached.

Changed in network-manager (Ubuntu):
importance: Undecided → Medium
Revision history for this message
Kevin Brubeck Unhammer (unhammer) wrote :

I'm not sure if this is the same bug, but after upgrading to 15.04, I have to "sudo systemctl restart NetworkManager" to get back my network interfaces after a long suspend. If I test a short suspend/resume cycle, like a couple seconds, it works fine, but when I open my laptop in the morning I have to restart NetworkManager.

I attached a journalctl excerpt; I closed the lid last night at 20:29, then opened it this morning at 08:09 and first tried the hardware switch, then eventually restarted NetworkManager.

Revision history for this message
Kevin Brubeck Unhammer (unhammer) wrote :

(And I'm on a Thinkpad X200, 3.13.0-39-generic, networkmanager 0.9.10.0-4ubuntu15.1)

Revision history for this message
Wolf Rogner (war-rsb) wrote :
Download full text (21.9 KiB)

Additional observation:

Somehow upgrading the kernel did not happen. So the kernel stayed 3.19.0.15 for a while.

Other upgrades went fine. So for the last few days, I did not observe the phenomenon on this particular machine.
(Others, where the kernel war upgraded to 3.19.0.20 had the issue constantly)

After upgrading to 3.19.0.20 on this machine, the behaviour / issue reappeared.

here is the syslog. Mind 09:53:21 where NetworkManager deactivates for no reason.

...
Jun 4 09:53:05 mbr kernel: [13615.956552] bridge-wlan0: down
Jun 4 09:53:05 mbr kernel: [13615.956559] bridge-wlan0: detached
Jun 4 09:53:05 mbr kernel: [13615.956633] done.
Jun 4 09:53:05 mbr kernel: [13615.956642] video LNXVIDEO:00: Restoring backlight state
Jun 4 09:53:05 mbr kernel: [13615.958066] cfg80211: World regulatory domain updated:
Jun 4 09:53:05 mbr kernel: [13615.958069] cfg80211: DFS Master region: unset
Jun 4 09:53:05 mbr kernel: [13615.958070] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time)
Jun 4 09:53:05 mbr kernel: [13615.958072] cfg80211: (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm), (N/A)
Jun 4 09:53:05 mbr kernel: [13615.958074] cfg80211: (2457000 KHz - 2482000 KHz @ 40000 KHz), (300 mBi, 2000 mBm), (N/A)
Jun 4 09:53:05 mbr kernel: [13615.958075] cfg80211: (2474000 KHz - 2494000 KHz @ 20000 KHz), (300 mBi, 2000 mBm), (N/A)
Jun 4 09:53:05 mbr kernel: [13615.958077] cfg80211: (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 2000 mBm), (N/A)
Jun 4 09:53:05 mbr kernel: [13615.958078] cfg80211: (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 2000 mBm), (N/A)
Jun 4 09:53:05 mbr NetworkManager[922]: <info> wake requested (sleeping: yes enabled: yes)
Jun 4 09:53:05 mbr NetworkManager[922]: <info> waking up...
Jun 4 09:53:05 mbr NetworkManager[922]: <info> (wlan0): device state change: activated -> unmanaged (reason 'sleeping') [100 10 37]
Jun 4 09:53:05 mbr NetworkManager[922]: <info> (wlan0): deactivating device (reason 'sleeping') [37]
Jun 4 09:53:05 mbr systemd[1]: Started Run anacron jobs.
Jun 4 09:53:05 mbr systemd[1]: Starting Run anacron jobs...
Jun 4 09:53:05 mbr anacron[5425]: Anacron 2.3 started on 2015-06-04
Jun 4 09:53:05 mbr anacron[5425]: Will run job `cron.daily' in 5 min.
Jun 4 09:53:05 mbr anacron[5425]: Jobs will be executed sequentially
Jun 4 09:53:06 mbr wpa_supplicant[1134]: wlan0: CTRL-EVENT-SCAN-STARTED
Jun 4 09:53:06 mbr NetworkManager[922]: <info> (wlan0): canceled DHCP transaction, DHCP client pid 4639
Jun 4 09:53:06 mbr avahi-daemon[945]: Withdrawing address record for fe80::1610:9fff:fed2:25f7 on wlan0.
Jun 4 09:53:06 mbr avahi-daemon[945]: Leaving mDNS multicast group on interface wlan0.IPv6 with address fe80::1610:9fff:fed2:25f7.
Jun 4 09:53:06 mbr avahi-daemon[945]: Interface wlan0.IPv6 no longer relevant for mDNS.
Jun 4 09:53:06 mbr vmnet-natd: RTM_DELADDR: index:2, addr:10.1.0.103
Jun 4 09:53:06 mbr avahi-daemon[945]: Withdrawing address record for 10.1.0.103 on wlan0.
Jun 4 09:53:06 mbr avahi-daemon[945]: Leaving mDNS multicast group on interface wlan0.IPv4 with address 10.1.0.103.
Jun 4 09:53:06 mbr avahi-daemon[945]: Int...

Revision history for this message
Plurtu (plurtu) wrote :

I have the same log as #4 which is definitely a different bug. The network manager wakes prematurely before suspending causing it not to wake when resuming. I experienced this on lubuntu 15.04 but could not replicate it on Ubuntu 15.04. I isolated the problem down to xfce4-power-manager which is responsible for suspending on lid close or timeout (manually suspending with "systemctl suspend" works fine). It seems to have issues with the recent change to systemd, switching back to Upstart fixes the problem.

https://wiki.ubuntu.com/SystemdForUpstartUsers

Revision history for this message
Eduards Bezverhijs (mjasnik) wrote :

I'm having kinda the same problem. After suspend at work and resume after one hour at home, NM applet won't show my home networks at all - so no auto connection, of course.
If I do enable/disable wifi or try to connect to one of work wifi AP (which of course is not there but is still in the list in NM applet), then NM applet refreshes AP list and I'm able to connect.
I have nothing suspicios in pm-suspend log though.
It might be nm-applet issue maybe...

Revision history for this message
Magnus Hoff (maghoff) wrote :

I am experiencing the problem as originally described.

I have discovered that using the b43 driver module instead of wl fixes this problem: sudo rmmod wl ; sudo modprobe b43

However, this also makes any 5GHz networks disappear.

This makes me believe there is a bug in the wl module.

Revision history for this message
Wolf Rogner (war-rsb) wrote :

In kernel 3.19.0-26 the connection was reestablished sometimes (could not reproduce a pattern)
in kernel 3.19.0-27 (updated today) the situation is as initially described. The connection does not get reestablished after a resume, regardless of wheter
a. I previously disconnect and reconnect in the NM-applet
b. restart service NetworkManager

The log files demonstrate complete different behaviour on resume, restart of the service or reconnect from the applet. I cannot see any similarities at all.

Should I expect some reuse of code and behaviour or is this a complete misconception?

Revision history for this message
samson (samson-uo) wrote :

I have a similar symptom; doing

  sudo iwlist wlan0 scan

after resume tickles NetworkManager into seeing there's wifi available which it then connects to.

I did not test switching back to Upstart, however I am using xfce4-power-manager as mentioned in Comment 7.
If I close the lid, wifi does not work on resume, however if I do:

  pkexec xfce4-pm-helper --suspend

wifi is correctly restored on resume.

Revision history for this message
samson (samson-uo) wrote :

Putting the following into /etc/pm/sleep.d/12_wifi and chmod +x-ing the file solves the problem for me, but it's a bit of a hack.

#!/bin/bash
case $1 in
    "resume")
    iwlist scan
    ;;
esac

Revision history for this message
Wolf Rogner (war-rsb) wrote :

suggestion #12 does not change the situation on my machines
network stays down and I have to reconnect to the WiFi manually or restart Network Manager

Revision history for this message
Wolf Rogner (war-rsb) wrote :

back to suggestion #12:

It does not fire (still don't know why)

However, running iwlist scan (as sudo) DOES reconnect.

Today I connected to another network (which I use regulary. The connection was established immediately after resume.

After putting the machine to sleep again, no reconnect occured after resume.

Thus my observation:

If after wake-up the network environment is the same, network manager DOES NOT reconnect.
If after wake-up the network is different (other SSIDs or SSID not found) a scan is launched automatically and a reconnect occurs.

Revision history for this message
samson (samson-uo) wrote :

After upgrading to Trusty w/ systemd, the script needs to named /lib/systemd/system-sleep/12_wifi, and 'resume' changed to 'post'

#!/bin/bash

case $1 in
    "post")
    iwlist scan >/dev/null 2>&1
    ;;
esac

Revision history for this message
Wolf Rogner (war-rsb) wrote :

suggestion #15 does not work either.

Linux mbr 3.19.0-31-generic #36-Ubuntu SMP Wed Oct 7 15:04:02 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
using systemd

Revision history for this message
Ajay Anand (aanand-ub) wrote :

The bug affects me too and in my case it is serious because my wifi connection is unstable.

Revision history for this message
Wolf Rogner (war-rsb) wrote :

I can confirm that this bug is eliminated in 15.10.
Unfortunately another old bug reappeared (random disconnect).
I will look into this in more detail.

For me it is solved.

Thanks

Revision history for this message
Nathaniel Homier (mechamechanism) wrote :

Bug still there in System76 Wild Dog Pro. Ubuntu 15.10.

Revision history for this message
Oliver (t.raum) wrote :

I run 14.04 and have the same issues since a few weeks. I fixed the problem by removing network-manager and installing connman.

Revision history for this message
lauricat (lauricat) wrote :

I have this bug as well in a clean MATE 16.04 install.

 x220, Intel 6205 wireless . Using the firmware iwlwifi 18.168.6.1

Various things like #12 sudo iwlist wlan0 scan - does not work for me.

Also disabling Wireless and/or networking via Network Manager - and re-enabling does nothing.

Nor does using hardware on/off/on for wifi make a difference.

Rebooting fixes it.

I have tried this fix

http://ubuntuforums.org/showthread.php?t=1984317&page=3

[which is a seperate fix for the Intel Wireless hardware flaky WiFi connection - not related I feel]

Subsequently I have gone back to 14.04 MATE and works perfectly!

Is this a systemd issue perhaps?

Revision history for this message
Hans Deragon (deragon) wrote :

Looks like this bug is a duplicate of Bug #1585863. But I will leave experts in the matter to decide and declare the duplication, if any.

Revision history for this message
Mohamed IKBEL Boulabiar (boulabiar) wrote :

I have the same problem in 16.04 for my Wifi.

$ lspci -knn | grep Net -A2
04:00.0 Network controller [0280]: Qualcomm Atheros AR9485 Wireless Network Adapter [168c:0032] (rev 01)
 Subsystem: AzureWave AR9485 Wireless Network Adapter [1a3b:2126]
 Kernel driver in use: ath9k
 Kernel modules: ath9k

The following command fixes my problem
"sudo systemctl restart NetworkManager"

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.