Does not automatically reconnect to hidden WiFi network

Bug #1316634 reported by John Hupp
76
This bug affects 15 people
Affects Status Importance Assigned to Milestone
network-manager (Ubuntu)
Confirmed
Low
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

Revision history for this message
John Hupp (john.hupp) 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
Michael Mess (michael-michaelmess) wrote :

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

Revision history for this message
Michael Mess (michael-michaelmess) wrote :

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$

Revision history for this message
Michael Mess (michael-michaelmess) wrote :

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

Revision history for this message
Michael Mess (michael-michaelmess) wrote :

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).

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

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
Revision history for this message
Michael Mess (michael-michaelmess) wrote :

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.

Revision history for this message
Michael Mess (michael-michaelmess) wrote :

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.

Revision history for this message
Michael Mess (michael-michaelmess) wrote :

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?

Revision history for this message
Michael Mess (michael-michaelmess) wrote :

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.

Revision history for this message
Michael Mess (michael-michaelmess) wrote :

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.

Revision history for this message
Alf HP 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.

Revision history for this message
K (brainimplants) wrote :

I'm confirming this bug 6 years later is real and unfixed still! The solution worked for me. Can this be patched ASAP?

Revision history for this message
K (brainimplants) wrote :

On the Debian bug site it shows that adding wifi.hidden yes via "nmcli connection modify XXXX wifi.hidden yes" does seem to produce a solution but it only works one time. When I did this and restarted network manager service I had hidden wifi connect once successfully but it wouldn't do it again when I cycled the wifi interface down/up.

Revision history for this message
dr.falken (steven-falken) wrote :

I have never had this problem on the same laptop (asus f550l) with every LTS from 14.04 but it appears with 20.04

Revision history for this message
Sebastien Bacher (seb128) wrote :

Could someone having the issue report directly upstream to https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/ ?

Changed in network-manager (Ubuntu):
importance: Undecided → Low
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related questions

Remote bug watches

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