Bug 706204 - NetworkManager doesn't auto connect to known wireless networks after system startup
Summary: NetworkManager doesn't auto connect to known wireless networks after system s...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: NetworkManager
Version: 15
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Dan Williams
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-05-19 18:34 UTC by Tomas Lestach
Modified: 2011-07-06 21:33 UTC (History)
8 users (show)

Fixed In Version: NetworkManager-0.8.9997-5.git20110702.fc15
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-07-06 21:33:21 UTC
Type: ---


Attachments (Terms of Use)
[PATCH] ensure connections are auto-activated even when secrets are in a keyring (10.19 KB, patch)
2011-06-28 14:24 UTC, Jirka Klimes
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
KDE Software Compilation 276575 0 None None None Never

Description Tomas Lestach 2011-05-19 18:34:34 UTC
Description of problem:
NetworkManager in F14 used to connect to known wireless networks after system startup. F15 NetworkManager doesn't do that.

Version-Release number of selected component (if applicable):
NetworkManager-0.8.999-2.git20110509.fc15.x86_64

How reproducible:
always

Steps to Reproduce:
1. Have F14 with having stored wireless networks together with all the settings and passwords. (When turning on the computer or just waking up from stand by mode, NetworkManager automatically connected to the predefined wireless networks, if available.)
2. Upgrade to F15
  
Actual results:
NetworkManager doesn't automatically connect to any wireless networks, even if they're available. Not even to the last used one.
Wireless network has to be chosen manually.

Expected results:
Same behavior as in F14.

Additional info:
This is a regression against NetworkManager in F14 and older.

Comment 1 Jirka Klimes 2011-05-23 12:05:34 UTC
Are you able to connect manually (clicking on the network in applet)?

Could you post output of:
1. nm-tool
2. nmcli -f all con list

Comment 2 Tomas Lestach 2011-05-23 17:24:36 UTC
Yes manual connect works, as I write in the Actual Results: 'Wireless network has to be chosen manually.'

I'll post required outputs from a location, where I have a wireless connection predefined.

Comment 5 Stephen O. Gombosi 2011-05-31 08:16:05 UTC
I'm experiencing the same issue. I'm no longer automatically connecting to known wireless networks and must click on them manually.
------------------------------------
[root@lap369 yum.repos.d]# nm-tool

NetworkManager Tool

State: connected (global)

- Device: wlan0  [Auto sognet] -------------------------------------------------
  Type:              802.11 WiFi
  Driver:            iwl3945
  State:             connected
  Default:           yes
  HW Address:        00:18:DE:8B:49:B1

  Capabilities:
    Speed:           54 Mb/s

  Wireless Properties
    WEP Encryption:  yes
    WPA Encryption:  yes
    WPA2 Encryption: yes

  Wireless Access Points (* = current AP)
    306524:          Infra, 00:22:3F:45:F1:D4, Freq 2422 MHz, Rate 54 Mb/s, Strength 17 WPA WPA2
    Abundance:       Infra, E0:91:F5:B5:F2:36, Freq 2437 MHz, Rate 54 Mb/s, Strength 15 WPA
    Center for Ants: Infra, 00:19:E3:33:5F:12, Freq 2422 MHz, Rate 54 Mb/s, Strength 17 WPA WPA2
    collinrouter:    Infra, 00:0C:41:49:51:9F, Freq 2437 MHz, Rate 11 Mb/s, Strength 24 WEP
    *sognet:         Infra, 00:24:B2:28:E9:35, Freq 2442 MHz, Rate 54 Mb/s, Strength 78 WEP
    ncp_home:        Infra, 00:13:46:A9:81:E4, Freq 2437 MHz, Rate 54 Mb/s, Strength 19
    EMILY-PC_Network:Infra, 00:26:F2:9A:BD:26, Freq 2417 MHz, Rate 54 Mb/s, Strength 20 WPA2
    sognet:          Infra, C0:3F:0E:0A:81:AC, Freq 2462 MHz, Rate 54 Mb/s, Strength 62 WPA WPA2

  IPv4 Settings:
    Address:         192.168.2.104
    Prefix:          24 (255.255.255.0)
    Gateway:         192.168.2.1

    DNS:             192.168.2.1


- Device: eth0 -----------------------------------------------------------------
  Type:              Wired
  Driver:            b44
  State:             unavailable
  Default:           no
  HW Address:        00:15:C5:B6:42:47

  Capabilities:
    Carrier Detect:  yes
    Speed:           10 Mb/s

  Wired Properties
    Carrier:         off


- VPN:  [Altair] ---------------------------------------------------------------
  State:             connected
  Default:           no


[root@lap369 yum.repos.d]# 
-------------------

I cannot post nmcli output, because it contains SSIDs of client sites.

Comment 6 Jirka Klimes 2011-05-31 10:11:36 UTC
Is the SSID it doesn't connect to hidden? It's the known issue - see bug 707406.

Otherwise, please grab /var/log/messages file. Also, Tomas, if you want to connect to belkin54g, check in nm-connection-editor on 'Wireless' that BSSID matches the nm-tool output or just remove it. (NM locks the connection for specific BSSID to prevent connecting to unknown networks with the same default SSID (for manufacturer SSIDs like belkin54g, etc.))

Comment 7 Stephen O. Gombosi 2011-05-31 19:27:09 UTC
No, the SSID (in my case, I can't speak for Tomas) is not hidden. I *do* see the following error in /var/log/messages:

------
May 31 01:49:58 lap369 NetworkManager[773]: <error> [1306828198.4466] [nm-session-monitor.c:349] nm_session_monitor_init(): Error loading /var/run/ConsoleKit/database: Error statting file /var/run/ConsoleKit/database: No such file or directory
May 31 01:49:58 lap369 NetworkManager[773]: <info> Loaded plugin keyfile: (c) 2007 - 2010 Red Hat, Inc.  To report bugs please use the NetworkManager mailing list.
-----
just before the keyfile parsing messages. The connection in question (my home network) seems to parse correctly:

----
May 31 01:49:58 lap369 NetworkManager[773]:    keyfile: parsing Auto sognet ...
May 31 01:49:58 lap369 NetworkManager[773]:    keyfile:     read connection 'Auto sognet'
-----

When NetworkManager attempts to bring it up automatically a minute later, I see:

------------------
May 31 01:50:49 lap369 NetworkManager[773]: <info> Activation (wlan0) starting connection 'Auto sognet'
May 31 01:50:49 lap369 NetworkManager[773]: <info> (wlan0): device state change: disconnected -> prepare (reason 'none') [30 40 0]
May 31 01:50:49 lap369 NetworkManager[773]: <info> Activation (wlan0) Stage 1 of 5 (Device Prepare) scheduled...
May 31 01:50:49 lap369 NetworkManager[773]: <info> Activation (wlan0) Stage 1 of 5 (Device Prepare) started...
May 31 01:50:49 lap369 NetworkManager[773]: <info> Activation (wlan0) Stage 2 of 5 (Device Configure) scheduled...
May 31 01:50:49 lap369 NetworkManager[773]: <info> Activation (wlan0) Stage 1 of 5 (Device Prepare) complete.
May 31 01:50:49 lap369 NetworkManager[773]: <info> Activation (wlan0) Stage 2 of 5 (Device Configure) starting...
May 31 01:50:49 lap369 NetworkManager[773]: <info> (wlan0): device state change: prepare -> config (reason 'none') [40 50 0]
May 31 01:50:49 lap369 NetworkManager[773]: <info> Activation (wlan0/wireless): access point 'Auto sognet' has security, but secrets are required.
May 31 01:50:49 lap369 NetworkManager[773]: <info> (wlan0): device state change: config -> need-auth (reason 'none') [50 60 0]
May 31 01:50:49 lap369 NetworkManager[773]: <info> Activation (wlan0) Stage 2 of 5 (Device Configure) complete.
May 31 01:50:49 lap369 NetworkManager[773]: <warn> No agents were available for this request.
May 31 01:50:49 lap369 NetworkManager[773]: <info> (wlan0): device state change: need-auth -> failed (reason 'no-secrets') [60 120 7]
May 31 01:50:49 lap369 NetworkManager[773]: <warn> Activation (wlan0) failed for access point (sognet)
May 31 01:50:49 lap369 NetworkManager[773]: <info> Marking connection 'Auto sognet' invalid.
May 31 01:50:49 lap369 NetworkManager[773]: <warn> Activation (wlan0) failed.
May 31 01:50:49 lap369 NetworkManager[773]: <info> (wlan0): device state change: failed -> disconnected (reason 'none') [120 30 0]
May 31 01:50:49 lap369 NetworkManager[773]: <info> (wlan0): deactivating device (reason: 0).
------------------------

Clicking on the connection is successful just 33 seconds later:

-----------------------
May 31 01:51:22 lap369 NetworkManager[773]: <info> Activation (wlan0) starting connection 'Auto sognet'
May 31 01:51:22 lap369 NetworkManager[773]: <info> (wlan0): device state change: disconnected -> prepare (reason 'none') [30 40 0]
May 31 01:51:22 lap369 NetworkManager[773]: <info> Activation (wlan0) Stage 1 of 5 (Device Prepare) scheduled...
May 31 01:51:22 lap369 NetworkManager[773]: <info> Activation (wlan0) Stage 1 of 5 (Device Prepare) started...
May 31 01:51:22 lap369 NetworkManager[773]: <info> Activation (wlan0) Stage 2 of 5 (Device Configure) scheduled...
May 31 01:51:22 lap369 NetworkManager[773]: <info> Activation (wlan0) Stage 1 of 5 (Device Prepare) complete.
May 31 01:51:22 lap369 NetworkManager[773]: <info> Activation (wlan0) Stage 2 of 5 (Device Configure) starting...
May 31 01:51:22 lap369 NetworkManager[773]: <info> (wlan0): device state change: prepare -> config (reason 'none') [40 50 0]
May 31 01:51:22 lap369 NetworkManager[773]: <info> Activation (wlan0/wireless): access point 'Auto sognet' has security, but secrets are required.
May 31 01:51:22 lap369 NetworkManager[773]: <info> (wlan0): device state change: config -> need-auth (reason 'none') [50 60 0]
May 31 01:51:22 lap369 NetworkManager[773]: <info> Activation (wlan0) Stage 2 of 5 (Device Configure) complete.
May 31 01:51:22 lap369 NetworkManager[773]: <info> Activation (wlan0) Stage 1 of 5 (Device Prepare) scheduled...
May 31 01:51:22 lap369 NetworkManager[773]: <info> Activation (wlan0) Stage 1 of 5 (Device Prepare) started...
May 31 01:51:22 lap369 NetworkManager[773]: <info> (wlan0): device state change: need-auth -> prepare (reason 'none') [60 40 0]
May 31 01:51:22 lap369 NetworkManager[773]: <info> Activation (wlan0) Stage 2 of 5 (Device Configure) scheduled...
May 31 01:51:22 lap369 NetworkManager[773]: <info> Activation (wlan0) Stage 1 of 5 (Device Prepare) complete.
May 31 01:51:22 lap369 NetworkManager[773]: <info> Activation (wlan0) Stage 2 of 5 (Device Configure) starting...
May 31 01:51:22 lap369 NetworkManager[773]: <info> (wlan0): device state change: prepare -> config (reason 'none') [40 50 0]
May 31 01:51:22 lap369 NetworkManager[773]: <info> Activation (wlan0/wireless): connection 'Auto sognet' has security, and secrets exist.  No new secrets needed.
May 31 01:51:22 lap369 NetworkManager[773]: <info> Config: added 'ssid' value 'sognet'
May 31 01:51:22 lap369 NetworkManager[773]: <info> Config: added 'scan_ssid' value '1'
May 31 01:51:22 lap369 NetworkManager[773]: <info> Config: added 'key_mgmt' value 'NONE'
May 31 01:51:22 lap369 NetworkManager[773]: <info> Config: added 'auth_alg' value 'OPEN'
May 31 01:51:22 lap369 NetworkManager[773]: <info> Config: added 'wep_key0' value '<omitted>'
May 31 01:51:22 lap369 NetworkManager[773]: <info> Config: added 'wep_tx_keyidx' value '0'
May 31 01:51:22 lap369 NetworkManager[773]: <info> Activation (wlan0) Stage 2 of 5 (Device Configure) complete.
May 31 01:51:22 lap369 NetworkManager[773]: <info> Config: set interface ap_scan to 1
May 31 01:51:22 lap369 NetworkManager[773]: <info> (wlan0): supplicant interface state: inactive -> scanning
May 31 01:51:25 lap369 NetworkManager[773]: <info> (wlan0): supplicant interface state: scanning -> authenticating
May 31 01:51:25 lap369 NetworkManager[773]: <info> (wlan0): supplicant interface state: authenticating -> associating
May 31 01:51:25 lap369 kernel: [  106.997449] ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
May 31 01:51:25 lap369 NetworkManager[773]: <info> (wlan0): supplicant interface state: associating -> completed
May 31 01:51:25 lap369 NetworkManager[773]: <info> Activation (wlan0/wireless) Stage 2 of 5 (Device Configure) successful.  Connected to wireless network 'sognet'.
May 31 01:51:25 lap369 NetworkManager[773]: <info> Activation (wlan0) Stage 3 of 5 (IP Configure Start) scheduled.
May 31 01:51:25 lap369 NetworkManager[773]: <info> Activation (wlan0) Stage 3 of 5 (IP Configure Start) started...
May 31 01:51:25 lap369 NetworkManager[773]: <info> (wlan0): device state change: config -> ip-config (reason 'none') [50 70 0]
May 31 01:51:25 lap369 NetworkManager[773]: <info> Activation (wlan0) Beginning DHCPv4 transaction (timeout in 45 seconds)
May 31 01:51:25 lap369 NetworkManager[773]: <info> dhclient started with pid 2795
May 31 01:51:25 lap369 NetworkManager[773]: <info> Activation (wlan0) Stage 3 of 5 (IP Configure Start) complete.
--------------------------

Comment 8 Jirka Klimes 2011-06-01 14:56:55 UTC
Stephen, thanks for the messages log!
I think I know what's going on now.

Previously, in F14, your wireless connection were configured and managed by user settings service (nm-applet) and thus the connection could be activated even after the user log in.
Now, all connection are managed by NM itself and can be activated just after NM is started.
When you upgraded, the password for the connection got marked as managed by secret agent (nm-applet). So, when connection is auto-activated after boot, nm-applet is not run yet and thus no password is available and activation fails.

You have to save the password in NM instead of nm-applet if you want auto-activation before login. You can do that by nm-connection-editor:
1. run nm-connection-editor
2. find your wireless connection in Wireless list, click Edit
3. fill password in 'Wireless Security' tab
2. "Save" connection

else you can also do that manually:
in /etc/sysconfig/network-scripts/ifcfg-<name>
remove WEP_KEY_FLAGS=user of (WPA_PSK_FLAGS of whatever _FLAGS key)

in /etc/sysconfig/network-scripts/keys-<name>
add your password
WPA_PSK="12345678" for WPA PSK
or
KEY1=s:ABCDE  or KEY1=6566676869 for WEP

Comment 9 Stephen O. Gombosi 2011-06-02 04:13:01 UTC
I tried using nm-connection-editor to set the key. Now it won't connect at all.  Not automatically, and not manually. 

Not helpful. 

How do I get back to my previous (broken but not catastrophically so) state?

Comment 10 Stephen O. Gombosi 2011-06-02 05:00:33 UTC
I noticed that after running nm-connection-manager, I had duplicate entries for my home network listed under "Wireless Networks". Looking at my /etc/NetworkManager/systemconnections directory, I see the following 3 files:

Auto sognet
sognet
sognet 1

I assume that the last two are detritus left from attempting to use nm-connection-editor. Anyway, deleting them permitted me to connect again (manually - automatic connections still don't work). I can't say that I'm a big fan of either FC15 or Gnome 3 at this point. All it seems to have done at this point is cost me functionality.

Comment 11 Stephen O. Gombosi 2011-06-02 05:02:34 UTC
:g/connection-manager/s//connection-editor/g

Comment 12 Jirka Klimes 2011-06-02 10:10:49 UTC
Hmm, setting the password (or editing the connection) through the editor should not do any harm.

Please, remove the files or delete the connection in the editor. Then click in applet on network SSID to create the connection again.
And post the file created, obfuscate the password.

What you have in NM config file?
$ cat /etc/NetworkManager/NetworkManager.conf

Comment 13 E Järvinen 2011-06-04 08:43:38 UTC
I've been having a very similar problem since last update (yesterday - no updates to NM, but whatevs, still wouldn't connect).  All it said to me on command line in response to ifup <connection_name> was Error: unknown connection, plus a long hex UUID of the said connection.

Here's how I solved it: I deleted the old connections, and configured a new connection with nm-connection-editor.  For some reason, the UUID of the wireless adapter had changed: no idea as to why this happened. Here's the ifcfg files:

ifcfg-systemwide (old, non-working version):

ESSID="whatever"
MODE=Managed
KEY_MGMT=WPA-PSK
TYPE=Wireless
BOOTPROTO=none
IPADDR=192.168.0.6
PREFIX=24
GATEWAY=192.168.0.1
DNS1=213.243.153.171
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME=systemwide
UUID=39156dab-10c5-4d9c-98a9-32e178c08c0b
ONBOOT=yes

And the new (working) version:

ESSID="whatever"
MODE=Managed
KEY_MGMT=WPA-PSK
TYPE=Wireless
BOOTPROTO=none
IPADDR0=192.168.0.6
PREFIX0=24
GATEWAY0=192.168.0.1
DNS1=213.243.153.171
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME=systemwide
UUID=be5e3dd6-397d-45a8-a908-327a59be4f5e
ONBOOT=yes

ESSID is hidden, I start the network in rc.local with a simple "ifup systemwide" (this comp is connected to a shared printer, so it has to be up before I log in so other people can print).

The only difference is the UUID of the connection, everything else has stayed the same.

Comment 14 ultimal 2011-06-25 14:28:33 UTC
After reading this bug report I went and got the NetworkManager source and tried to build it. During that process I was prompted for several devel libraries. I install them all and was finally able to build network manager from source. I didn't install the version I built. I just wanted to make sure it would build before I started making changes to fix this issue. By chance, I restarted my PC and noticed that by simply installing some of the devel libraries this problem was resolved. Network Manager (FC15) now connects automatically to my previous wireless connection or WPA2 wireless connection.

Comment 15 Jirka Klimes 2011-06-28 14:24:42 UTC
Created attachment 510289 [details]
[PATCH] ensure connections are auto-activated even when secrets are in a keyring


The patch solves the problem described in comment #8: NM didn't auto-activate a connection while booting, because of missing secrets (stored in a user keyring). And the connection was not re-tried later when user logged in.

The patch removes the invalid flag for such connections and re-tries them when a secret agent is registered (user logs in).

Comment 16 Dan Williams 2011-06-30 16:18:14 UTC
Patch looks good, thanks!

Comment 17 Jirka Klimes 2011-07-01 07:23:22 UTC
Pushed upstream 69b767bbf0ef8e038dd8bd0bcb35586c0f91ade7 (master)

Comment 18 Fedora Update System 2011-07-02 21:37:20 UTC
NetworkManager-0.8.9997-5.git20110702.fc15 has been submitted as an update for Fedora 15.
https://admin.fedoraproject.org/updates/NetworkManager-0.8.9997-5.git20110702.fc15

Comment 19 Fedora Update System 2011-07-03 19:20:47 UTC
Package NetworkManager-0.8.9997-5.git20110702.fc15:
* should fix your issue,
* was pushed to the Fedora 15 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing NetworkManager-0.8.9997-5.git20110702.fc15'
as soon as you are able to, then reboot.
Please go to the following url:
https://admin.fedoraproject.org/updates/NetworkManager-0.8.9997-5.git20110702.fc15
then log in and leave karma (feedback).

Comment 20 Fedora Update System 2011-07-06 21:33:11 UTC
NetworkManager-0.8.9997-5.git20110702.fc15 has been pushed to the Fedora 15 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.