Does not automatically reconnect to hidden WiFi network

Bug #1316634 reported by John Hupp on 2014-05-06
56
This bug affects 11 people
Affects Status Importance Assigned to Milestone
network-manager (Ubuntu)
Undecided
Unassigned

Bug Description

Running Lubuntu 14.04 32-bit on a Lenovo 3000 C200 laptop with an integrated Broadcom network adapter, I installed firmware-b43-installer and then successfully connected to my hidden (SSID not broadcast) WiFi net.

But I see that it will not automatically reconnect. I don't have to re-enter the password, but I do have to click the nm-applet indicator, choose 'Connect to Hidden Wi-Fi Network' and then choose my already-defined connection, which indeed has been saved but not used to automatically reconnect.

If I edit the connection, I see that on the General tab it is already set to 'Automatically connect to this network when it is available.'

The only way I can get automatic reconnection is to enable SSID Broadcast.

And a similar effect: If I am connected to the network while SSID Broadcast is in effect and then disable SSID Broadcast, network-manager immediately loses the connection.

Someone suggested that network-manager would find the hidden network if I just waited, but after waiting 15 minutes it had still not connected.

Dual-booting this same laptop with Windows Vista, I see that Windows knows how to automatically reconnect to the hidden net.

I see that https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/295796 describes similar behavior, but that was reported back in 2008 and I'm imagining that there should be a separate report for the new release.

ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: network-manager 0.9.8.8-0ubuntu7
ProcVersionSignature: Ubuntu 3.13.0-24.46-generic 3.13.9
Uname: Linux 3.13.0-24-generic i686
ApportVersion: 2.14.1-0ubuntu3
Architecture: i386
CRDA: Error: [Errno 2] No such file or directory: 'iw'
CurrentDesktop: LXDE
Date: Tue May 6 10:24:32 2014
IfupdownConfig:
 # interfaces(5) file used by ifup(8) and ifdown(8)
 auto lo
 iface lo inet loopback
InstallationDate: Installed on 2014-04-25 (10 days ago)
InstallationMedia: Lubuntu 14.04 LTS "Trusty Tahr" - Release i386 (20140416.2)
IpRoute:
 default via 192.168.1.1 dev wlan0 proto static
 192.168.1.0/24 dev wlan0 proto kernel scope link src 192.168.1.118 metric 9
NetworkManager.state:
 [main]
 NetworkingEnabled=true
 WirelessEnabled=true
 WWANEnabled=true
 WimaxEnabled=true
RfKill:
 0: phy0: Wireless LAN
  Soft blocked: no
  Hard blocked: no
SourcePackage: network-manager
UpgradeStatus: No upgrade log present (probably fresh install)
nmcli-con:
 NAME UUID TYPE TIMESTAMP TIMESTAMP-REAL AUTOCONNECT READONLY DBUS-PATH
 Wired connection 1 ac7ba941-660f-40c5-9b1f-4d24accc6225 802-3-ethernet 1399385892 Tue 06 May 2014 10:18:12 AM EDT yes no /org/freedesktop/NetworkManager/Settings/1
 PRP d25473c0-98d8-4d93-ab37-3dd070bbd34b 802-11-wireless 1399386192 Tue 06 May 2014 10:23:12 AM EDT yes no /org/freedesktop/NetworkManager/Settings/0
nmcli-dev:
 DEVICE TYPE STATE DBUS-PATH
 eth0 802-3-ethernet unavailable /org/freedesktop/NetworkManager/Devices/1
 wlan0 802-11-wireless connected /org/freedesktop/NetworkManager/Devices/0
nmcli-nm:
 RUNNING VERSION STATE NET-ENABLED WIFI-HARDWARE WIFI WWAN-HARDWARE WWAN
 running 0.9.8.8 connected enabled enabled enabled enabled disabled

John Hupp (john.hupp) wrote :
Launchpad Janitor (janitor) wrote :

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

Changed in network-manager (Ubuntu):
status: New → Confirmed

I have this issue on a Thinkpad with Xubuntu 15.04.
It seems not to be hardware-related.

The solution:
Uncomment the code which has been commented out due to an already fixed gnome bug. This fixed the issue for me. Please confirm that it does fix it for you, too.

michael@thinkpad:/etc$ git diff NetworkManager/dispatcher.d/01ifupdown
diff --git a/NetworkManager/dispatcher.d/01ifupdown b/NetworkManager/dispatcher.d/01ifupdown
index ebadfd1..f4de9cc 100755
--- a/NetworkManager/dispatcher.d/01ifupdown
+++ b/NetworkManager/dispatcher.d/01ifupdown
@@ -55,16 +55,16 @@ for i in $ADDRESS_FAMILIES; do
             ;;
 # pre-up/pre-down not implemented. See
 # https://bugzilla.gnome.org/show_bug.cgi?id=387832
-# pre-up)
-# export MODE="start"
-# export PHASE="pre-up"
-# run-parts /etc/network/if-pre-up.d
-# ;;
-# pre-down)
-# export MODE="stop"
-# export PHASE="pre-down"
-# run-parts /etc/network/if-down.d
-# ;;
+ pre-up)
+ export MODE="start"
+ export PHASE="pre-up"
+ run-parts /etc/network/if-pre-up.d
+ ;;
+ pre-down)
+ export MODE="stop"
+ export PHASE="pre-down"
+ run-parts /etc/network/if-down.d
+ ;;
         hostname|dhcp4-change|dhcp6-change)
             # Do nothing
             ;;
michael@thinkpad:/etc$

Created patch for the /etc/NetworkManager/dispatcher.d/01ifupdown script.

The patch works with Xubuntu 15.04, but the bug has been reported for Ubuntu 14.04.
Can someone confirm that the patch is sufficient to solve the issue on Ubuntu 14.04?
Probably the network-manager needs to be updated, too, if the version provided with Ubuntu 14.04 still lacks support for pre-up/pre-down (https://bugzilla.gnome.org/show_bug.cgi?id=387832).

The attachment "Patch for the /etc/NetworkManager/dispatcher.d/01ifupdown script" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch

Unfortuately I have to admit that my patch did not really solve th issue.

While yesterday the problem did not reappear, today I was experiencing the problem again.

Before I was thinking, that the problem appeared everytime when the network was connected before and thus when not manually connecting on every second boot, but this might not be true, because yesterday I thought the issue was fixed, because the issue didn't appear after a reboot even when the network was connected before.

I was thinking, there was something like a state that survives a reboot and could be cleared with the patched script.
It might be that the patched script somehow changes some probabilities, but the issue is definitely not fixed.

When the issue occurs, the network manager tells me that there are wireless networks available, but it does not connect automatically to the hidden network.

Probably there is some state that is stored in NetworkManager:
* When you have manually disconnected from a wireless network, you probably don't want to reconnect automatically.
* When you was connected to a wireless network, you probably want to reconnect to that network.
* When you have manually chosen a specific network, you might want to connect only to that network

There should be something like on mobile phones where you can choose one network manually or let the phone choose the network automatically.

Maybe some of such state information survives a reboot.

Today I tried this:

michael@thinkpad:~$ sudo /etc/init.d/network-manager restart
[sudo] password for michael:
[ ok ] Restarting network-manager (via systemctl): network-manager.service.
michael@thinkpad:~$ sudo /etc/init.d/network-manager restart
[ ok ] Restarting network-manager (via systemctl): network-manager.service.
michael@thinkpad:~$ sudo /etc/init.d/networking restart
[ ok ] Restarting networking (via systemctl): networking.service.
michael@thinkpad:~$ sudo /etc/init.d/network-manager restart
[ ok ] Restarting network-manager (via systemctl): network-manager.service.
michael@thinkpad:~$

Restarting network-manager alone multiple times didn't lead to a wireless connection, but after networking restart and then network-manager restart the connect succeeded immediately.

Probably this gives a hint where to search for the issue.

To be sure, further tests are necessary, to be sure that this behaviour is reproducable.

Can someone confirm?

Now I have done further tests.
Sometimes calling network-manager restart once will suffice to get connected, but sometimes not. Then you can try again and again without getting a connection.
Then networking restart and then network-manager restart will do it.

michael@thinkpad:~$ sudo /etc/init.d/network-manager restart
[sudo] password for michael:
[ ok ] Restarting network-manager (via systemctl): network-manager.service.
michael@thinkpad:~$ sudo /etc/init.d/network-manager restart
[ ok ] Restarting network-manager (via systemctl): network-manager.service.
michael@thinkpad:~$ sudo /etc/init.d/network-manager restart
[ ok ] Restarting network-manager (via systemctl): network-manager.service.
michael@thinkpad:~$ sudo /etc/init.d/network-manager restart
[ ok ] Restarting network-manager (via systemctl): network-manager.service.
michael@thinkpad:~$ sudo /etc/init.d/network-manager restart
[ ok ] Restarting network-manager (via systemctl): network-manager.service.
michael@thinkpad:~$ sudo /etc/init.d/network-manager restart
[ ok ] Restarting network-manager (via systemctl): network-manager.service.
michael@thinkpad:~$ sudo /etc/init.d/network-manager restart
[ ok ] Restarting network-manager (via systemctl): network-manager.service.
michael@thinkpad:~$ sudo /etc/init.d/network restart
networking network-manager
michael@thinkpad:~$ sudo /etc/init.d/networking restart
[ ok ] Restarting networking (via systemctl): networking.service.
michael@thinkpad:~$ sudo /etc/init.d/network-manager restart
[ ok ] Restarting network-manager (via systemctl): network-manager.service.
michael@thinkpad:~$

Thus it seems that sometimes on a failed connect something gets broken so that it prevents you from getting a connection and that can be repaired by doing a networking restart.
I hope that this is useful to find the cause of this bug.

Next steps:
 - 1) Check the file /var/lib/NetworkManager/NetworkManager.state when the problem occurs next time.

With connected network it looks like:

[main]
NetworkingEnabled=true
WirelessEnabled=true
WWANEnabled=true
WimaxEnabled=true

 - 2) Check the files in /var/lib/NetworkManager/ for their contents. Probably this might help to track down the problem.

Alf Haakon Lund (alf-c) wrote :

Running Ubuntu Studio (Xubuntu) 14.04 I had this or a very similar problem when I changed name and hid the SSID on my wifi.

nm-manager kept looking for the old SSID and would not connect to the hidden network - I had to connect manually on boot.

When I told nm-manager to forget the old wifi the problem disappeared. My computer now connects to the hidden SSID and networking is OK.

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

Other bug subscribers

Remote bug watches

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