Have to restart NetworkManager to get wifi autoconnect

1

I'm running Antergos (Arch) with KDE Plasma, all works but from last couple of days I have a network problem: wifi doesn't autoconnect.

I use NetworkManager.

Well, in fact, it autoconnects, but only after 5 minutes starting from boot! (5 minutes more or less).

Forcing the reload with

systemctl restart NetworkManager

It autoconnects.

Using journalctl, the (partial) output is:

dic 18 20:08:53 marco-E7450 NetworkManager[640]: <info>  [1513624133.0095] policy: auto-activating connection 'Wifi_Casa'
dic 18 20:08:53 marco-E7450 NetworkManager[640]: <info>  [1513624133.0106] device (wlp2s0): Activation: starting connection 'Wifi_Casa' (8a912e7f-0989-4d91-b9ae-b42e85eb37c6)
dic 18 20:08:53 marco-E7450 NetworkManager[640]: <info>  [1513624133.0109] device (wlp2s0): state change: disconnected -> prepare (reason 'none', sys-iface-state: 'managed')
dic 18 20:08:53 marco-E7450 NetworkManager[640]: <info>  [1513624133.0110] manager: NetworkManager state is now CONNECTING
dic 18 20:08:53 marco-E7450 NetworkManager[640]: <info>  [1513624133.0123] device (wlp2s0): set-hw-addr: reset MAC address to 10:02:B5:05:F0:EB (preserve)
dic 18 20:08:53 marco-E7450 NetworkManager[640]: <info>  [1513624133.0174] device (wlp2s0): state change: prepare -> config (reason 'none', sys-iface-state: 'managed')
dic 18 20:08:53 marco-E7450 NetworkManager[640]: <info>  [1513624133.0176] device (wlp2s0): Activation: (wifi) access point 'Wifi_Casa' has security, but secrets are required.
dic 18 20:08:53 marco-E7450 NetworkManager[640]: <info>  [1513624133.0176] device (wlp2s0): state change: config -> need-auth (reason 'none', sys-iface-state: 'managed')
dic 18 20:08:53 marco-E7450 NetworkManager[640]: <warn>  [1513624133.0185] device (wlp2s0): No agents were available for this request.
dic 18 20:08:53 marco-E7450 NetworkManager[640]: <info>  [1513624133.0186] device (wlp2s0): state change: need-auth -> failed (reason 'no-secrets', sys-iface-state: 'managed')
dic 18 20:08:53 marco-E7450 NetworkManager[640]: <info>  [1513624133.0187] manager: NetworkManager state is now DISCONNECTED
dic 18 20:08:53 marco-E7450 NetworkManager[640]: <warn>  [1513624133.0189] device (wlp2s0): Activation: failed for connection 'Wifi_Casa'
dic 18 20:08:53 marco-E7450 NetworkManager[640]: <info>  [1513624133.0194] device (wlp2s0): state change: failed -> disconnected (reason 'none', sys-iface-state: 'managed')
dic 18 20:08:53 marco-E7450 NetworkManager[640]: <info>  [1513624133.0207] device (wlp2s0): set-hw-addr: set MAC address to 52:7C:11:E8:AA:36 (scanning)
dic 18 20:08:53 marco-E7450 NetworkManager[640]: <info>  [1513624133.0506] device (wlp2s0): supplicant interface state: ready -> disconnected
dic 18 20:08:53 marco-E7450 NetworkManager[640]: <info>  [1513624133.0559] device (wlp2s0): supplicant interface state: disconnected -> inactive

Strange things are:

  1. After 5 minutes (5 o 6 connection attempts, with the same output message) it works automatically.
  2. If i reload NetworkManager, it immediately works.

What can i do? (I've tried to reinstall NetworkManager, nm-applet and all thing related)

Thanks in advance

rivamarco

Posted 2017-12-18T19:30:01.473

Reputation: 111

Answers

0

Resolved downgrading networkmanager from 1.10.2-1 to 1.10.0-1

Anyway, the 1.10.2-1 version won't autoconnect only with WPA2 password-protected network, I've tried with open network and it autoconnects.

My network controller (Dell Latitude E7450):

Network controller: Intel Corporation Wireless 7265 (rev 59)

rivamarco

Posted 2017-12-18T19:30:01.473

Reputation: 111

1

Those log outputs are all from the same second, that happens every minute or so from in the boot to 5min when it finally connects on it's own? It looks like some auth agent isn't running, but restarting the NetworkManager gets it going...

...secrets are required.
...device (wlp2s0): state change: config -> need-auth (reason 'none', sys-iface-state: 'managed')
...device (wlp2s0): No agents were available for this request.
...device (wlp2s0): state change: need-auth -> failed (reason 'no-secrets', sys-iface-state: 'managed')

I don't have a similar system to check, but according to archwiki's Network Manager: Connect to network with secret on boot:

By default, NetworkManager will not connect to networks requiring a secret automatically on boot. This is because it locks such connections to the user who makes it by default, only connecting after they have logged in. To change this, do the following:

  1. Right click on the nm-applet icon in your panel and select Edit Connections and open the Wireless tab

  2. Select the connection you want to work with and click the Edit button

  3. Check the boxes “Connect Automatically” and “Available to all users”

Log out and log back in to complete.

6.6 Automatically unlock keyring after login might be interesting too, if the above doesn't work.

NetworkManager requires access to the login keyring to connect to networks requiring a secret. Under most circumstances, this keyring is unlocked automatically at login, but if it isn't, and NetworkManager isn't connecting on login, you can try the following.

GNOME

Note: The following method is dated and known not to work on at least one machine!

  • In /etc/pam.d/gdm (or your corresponding daemon in /etc/pam.d), add these lines at the end of the "auth" and "session" blocks if they do not exist already:

    auth            optional        pam_gnome_keyring.so
    session         optional        pam_gnome_keyring.so  auto_start
    
  • In /etc/pam.d/passwd, use this line for the 'password' block:

    password    optional    pam_gnome_keyring.so
    

    Next time you log in, you should be asked if you want the password to be unlocked automatically on login.

SLiM login manager

See SLiM#Gnome Keyring.

Troubleshooting

While you may type both values at connection time, kdeplasma-applets-plasma-nm[broken link: archived in aur-mirror] 0.9.3.2-1 and above are capable of retrieving OpenConnect username and password directly from KWallet.

Open "KDE Wallet Manager" and look up your OpenConnect VPN connection under "Network Management|Maps". Click "Show values" and enter your credentials in key "VpnSecrets" in this form (replace username and password accordingly):

form:main:username%SEP%username%SEP%form:main:password%SEP%password

Next time you connect, username and password should appear in the "VPN secrets" dialog box.

[FYI, found that searching for NetworkManager secrets agent]

Xen2050

Posted 2017-12-18T19:30:01.473

Reputation: 12 097

I've already check the boxes “Connect Automatically” and “Available to all users”.

Those warning from the log appears 4 times starting from boot (one "connection try" every second), then nothing for a couple of minutes, then it autoconnects (after exactly 5 minutes after the last attempt). – rivamarco – 2017-12-18T20:36:04.790

Had more info, didn't hit "save edits", it's there now – Xen2050 – 2017-12-18T20:49:04.337

The keyring thing also dosen't work. I can't figure out the problem, i don't know what appened. – rivamarco – 2017-12-18T20:54:20.423

Look into the NetworkManager "control" file, what exactly does it do when it restarts? For some reason the secrets agent isn't working at boot, but is 5min later – Xen2050 – 2017-12-18T21:06:41.457

/etc/NetworkManager/NetworkManager.con is empty (only #). Journalctl in first run: https://pastebin.com/2CdHbjh7 after reload: https://pastebin.com/H2VE5vEv . seems identical.

– rivamarco – 2017-12-19T12:42:15.573

1

Try to set “Store password for all users (not encrypted)” in the Wi-Fi Security tab. I know it’s not the optimal solution, but it works for me.

See here

Mizanur Rahman Mojumder

Posted 2017-12-18T19:30:01.473

Reputation: 11