Can't use networkmanager from lightdm

Bug #1574020 reported by Joakim Koed
130
This bug affects 27 people
Affects Status Importance Assigned to Milestone
NetworkManager
Invalid
Medium
network-manager (Ubuntu)
Invalid
High
Aron Xu

Bug Description

After upgrading to 16.04 desktop (unity) (clean install) from 14.04, (so not really upgrading, but you get the point) I noticed that lightdm with unity-greeter (all stock, nothing changed) can't connect to WiFi with network-manager.

WiFi works after loggin it, but it should be working before also, if not, what's the point in having an icon there :)

I get the following message: Failed to add/activate connection. - (1) Insufficient privileges. - see image.
This worked fine in 14.04.

I have noticed this problem in both my desktop (Broadcom WiFi) and Laptop (Intel WiFi) - So it has nothing to be with the chip.

Feel free to ask for more info.

Edit:

From syslog:

Apr 23 16:50:46 desktop NetworkManager[979]: nm_settings_connection_delete: assertion 'NM_IS_SETTINGS_CONNECTION (self)' failed
Apr 23 16:50:46 desktop NetworkManager[979]: <info> [1461423046.1662] audit: op="connection-add-activate" pid=1275 uid=108 result="fail" reason="Insufficient privileges."
Apr 23 16:50:46 desktop NetworkManager[979]: (NetworkManager:979): GLib-GObject-CRITICAL **: g_object_unref: assertion 'G_IS_OBJECT (object)' failed

Revision history for this message
Joakim Koed (vooze) wrote :
summary: - networkmanager
+ Can't use networkmanager from lightdm
tags: added: lightdm
Joakim Koed (vooze)
description: updated
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
Steven Partridge (reynolds552) wrote :

Also affects me, fresh install Dell vostro 3750.

Revision history for this message
Michael Tapp (chimella) wrote :

I have this problem too. I also had the problem of the WiFi not working in Unity, I would enter the WiFi password and nothing happened. After I installed Gnome desktop, which I use, I was able to enter the WiFi password by clicking on the WiFi icon, opening Wi-Fi Settings, next to my hub was a configure icon, I set the password in there under the Security tab. Now I can connect without problems in both Unity and Gnome desktops. Mine was a fresh install Compaq CQ58 laptop. I still can't choose a WiFi at the login screen, but once logged in I'm okay now.

Revision history for this message
Franko Burolo (fburolo) wrote :

Exactly the same as the OP describes happens on my laptop, too. Clean install and all that. Except that before installing Xenial I was using Wily, and that I have Atheros wifi on a Toshiba laptop, which only confirms that "it has nothing to be with the chip", nor with the related modules/drivers.

The most obvious guess is it is a permission-related issue, but I don't know where or how to fix it... What "user" handles logged off NetworkManager? O_o

Revision history for this message
justen r meltz (justen) wrote :

It affects me too, on a clean install. Previously, this machine was running 16.04 that I had upgraded from 15.10. It worked fine with 15.10 and 16.04. Then, I ended up doing a clean install of 16.04, for unrelated issues, and now I have this problem too.

Once I log in, my wireless autoconnects to my network. I just can't do it at the login screen.

I have two other wireless 16.04 machines, upgraded from 15.10, and they are fine. I have only seen this problem on a clean 16.04 install.

Revision history for this message
justen r meltz (justen) wrote :

I would bump the importance of this. After a reboot, my machine has no network connectivity until I login at the actual machine. This is a PITA for my remotely administered machine, which I normally access via SSH or RDP. My best workaround is to move this machine to a location where I can string a wired cat5e/6. Wired works fine.

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

Thank you for your bug report. Do you try to connect to a wifi you already used before? Is it an open one or does it require to enter credentials?

The greeter doesn't allow creating new connections but should let you activate existing ones. Here the system autoconnect to my usual wifi on boot while on the greeter, also picking the same wifi again works without error.

Trying to connect to new aps trigger the error dialog, that's not new though and has always been like that in Ubuntu

Changed in network-manager (Ubuntu):
importance: Undecided → High
status: Confirmed → Incomplete
Revision history for this message
Sebastien Bacher (seb128) wrote :

(see bug #1247631 for example)

Revision history for this message
Joakim Koed (vooze) wrote :

Hello Sebastien, thank you for your response.

I just tested it, and it's the same error message for all networks (known and unknown)

Revision history for this message
Joakim Koed (vooze) wrote :

@seb128: Do you need more info? I don't know what to do next.

Changed in network-manager (Ubuntu):
status: Incomplete → Confirmed
status: Confirmed → Incomplete
Revision history for this message
Sebastien Bacher (seb128) wrote :

setting back to new, it works for me and I've no idea offhand, needs debugging (ideally by somebody getting the bug)

Changed in network-manager (Ubuntu):
status: Incomplete → New
Revision history for this message
Joakim Koed (vooze) wrote :

@seb128 Do you know how I could debug it for you? I would be glad to help, just don't know where to start.

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
Sebastien Bacher (seb128) wrote :

having a networkmanager debug log might help, the credential are granted in /var/lib/polkit-1/localauthority/10-vendor.d/unity-greeter.pkla so it would be interesting to know which one it's trying to use exactly (the first chunk has the denied one and the bottom one the allowed control)

Revision history for this message
Joakim Koed (vooze) wrote :

@seb128: I did some debugging. While this https://wiki.ubuntu.com/DebuggingNetworkManager was outdated, I suspect since systemd, it was not so easy. I did found out though, that when changing to tty1-6 and loggin in, then changing to tty7 I can use networkmanager from lightdm. But not before loggin in.

Do you know how to debug with systemd? I looked in journalctl but could not find anything relevant :(

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

Hum, editing /lib/systemd/system/NetworkManager.service and sharing /var/log/system or journatctl logs should work

Revision history for this message
Joakim Koed (vooze) wrote :

@seb128: I tried two things.. First i used the NetworkManager.service from 15.10 which was a bit different, but same result.

Then I reverted back and got the full log from syslog. here: http://paste.ubuntu.com/16475211/

You can see on line 90, May 17 16:18:36, that is where i login and all is well, just before that:

May 17 16:18:31 desktop NetworkManager[944]: nm_settings_connection_delete: assertion 'NM_IS_SETTINGS_CONNECTION (self)' failed
May 17 16:18:31 desktop NetworkManager[944]: <info> [1463494711.7295] audit: op="connection-add-activate" pid=1282 uid=108 result="fail" reason="Insufficient privileges."
May 17 16:18:31 desktop NetworkManager[944]: (NetworkManager:944): GLib-GObject-CRITICAL **: g_object_unref: assertion 'G_IS_OBJECT (object)' failed

Does this help?

Revision history for this message
Xavier Charpentier (x-charpentier) wrote :

I can confirm this behavior on a fresh install of 16.04 on the Dell XPS 13 developer edition.
I get the same error message when trying to setup a wireless connection in lightdm. I don't whether this connected or not but the hotkeys (volume up/down, screen brightness) also don't work in lightdm. I installed kernel 4.6 because of the wireless toggle not working in 4.4. That solved the wireless toggle but did not change the issue in lightdm.

Revision history for this message
Joakim Koed (vooze) wrote :

Just added lightdm, since it works with gdm (ubuntu gnome 16.04) just fine.

Revision history for this message
Launchpad Janitor (janitor) wrote :

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

affects: lightdm (Ubuntu) → unity-greeter (Ubuntu)
Changed in unity-greeter (Ubuntu):
status: New → Confirmed
Revision history for this message
Danilo Silva (danilocsilva) wrote :

Hi.
Same problem here with a clean install.
I have a NAS mounted via fstab and it cannot get mounted on boot because of that (I suspect).
Very annoying.

Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in unity-greeter (Ubuntu):
status: New → Confirmed
Revision history for this message
ibrahim (ibrahimdarra-deactivatedaccount) wrote :

It affects me as well

Revision history for this message
Kristoffer Grundström (umeaman) wrote :

I'm also affected by it. Enbaling WiFi after logging in works fine, but not before. Fresh installation and nothing changed.

Revision history for this message
modolo (modolo) wrote :

LightDM - insufficient privileges

I have four computers with Ubuntu 16.04, two have been updated from 15.10 to 16.04 and two were installed from scratch.

On machines that have been updated, you can select an already configured connection (LightDM user can not create, change or remove connections) before you log in. In the updated machine, an available connection is automatically selected and so it is possible to ssh to the machine.

On machines that received the 16:04 version, LightDM user can not select one of the connections previously created displaying the error insufficient privileges.

After checking the logs and the differences in the configuration files between the machines I realized that the files in /etc/NetworkManager/system-connections/* had small differences!

Installed machines from scratch:

[Connection]
id=corona
uuid=4ce20be5-d5a0-41c5-820c-852136fade99
type=wifi
permissions=user:modolo:;
secondaries=

Updated machines:

[Connection]
id=corona
uuid=9bbd3c2b-295b-45e0-b1da-5c6b72e3734d
type=wifi
permissions=
secondaries=

What has changed, in my view, with the new NetworkManager is that even when the connection is created and saved to ALL, permissions are created only for the user who is editing the connection (permissions=user:modolo:;).

After updating the permissions from "line=user:modolo:;" to "permissions=" in all connections files you can select the same before authentication and in addition, if any of the connections is active, it is automatically selected.

I hope this helps and works for everyone.

Hugs,
Marcelo Modolo

Revision history for this message
Joakim Koed (vooze) wrote :

modolo: THANK YOU!! This was driving me nuts.. Your solution 100% works.

Now we just need devs of network-manager to figure out why the permissions are wrong.

Revision history for this message
Xavier Charpentier (x-charpentier) wrote :

I have two configured wifi connections.
For each I went to the config files and they both had the "permissions=user:username:;"
I removed "user:username:;" to restore "permissions="
Login out, I still had the insufficient privilege problem. But restarting solved the problem!!! Thank you modolo!

Joakim Koed (vooze)
tags: added: xenial yakkety
Changed in unity-greeter (Ubuntu):
importance: Undecided → High
Revision history for this message
justen r meltz (justen) wrote :

modolo: Thanks from me too! This fixes the problem!

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

Could somebody report that upstream on https://bugzilla.gnome.org/enter_bug.cgi?product=NetworkManager
They should know if that's a wanted change in the default permissions or a bug?

Changed in network-manager (Ubuntu):
assignee: nobody → Aron Xu (happyaron)
Revision history for this message
Joakim Koed (vooze) wrote :

Sebastien: reported. Let's see what happens :)

Changed in network-manager:
importance: Unknown → Medium
status: Unknown → Confirmed
Revision history for this message
Joakim Koed (vooze) wrote :

Hi again.

After talking to Thomas Haller from redhat, it seems that we can make it work just by enabling "all users may connect to this network" in network manager GUI.

Now the questions is, why did that change from 15.10 to 16.04? It is not disabled by default, instead of being enabled like it should!

Revision history for this message
Joakim Koed (vooze) wrote :

It is NOW* disabled

Revision history for this message
Joakim Koed (vooze) wrote :

This is apparently by choice in the newer versions of network-manager. Strange that it does not affect GDM though. But like I said you can change it in network-mananger applet/GUI.

https://git.gnome.org/browse/network-manager-applet/commit/?id=0c92debe95f62a7f677e28eb8dee92728d702a0a

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

ok, so it's a security choice from upstream, unsure if we should change the default ... what's the usecase to connect from the greeter? it's not a session you can do anything with so that seems a bit pointless. In any case the applet could probably deal better with the situation by not listing those a selectable or telling you in the error dialog what to do to make them work

Revision history for this message
Joakim Koed (vooze) wrote :

I agree the idea is good, it's just hard to figure out what is wrong when you are "greeted" with permissions in that nasty "pop op".
I personally don't care anymore, because now I know how to fix it, but for future users, it seems stupid.

Revision history for this message
Xavier Charpentier (x-charpentier) wrote :

A notification comes up the greeter advertising that wireless networks are available. The greeter should at least not invite you to connect if you can't...

Revision history for this message
Vincent Cheng (vincent-c) wrote :

A use case is that I would like to be able to ssh into my Ubuntu 16.04 laptop when I'm logged out, which is of course only possible if it's connected to a network.

Changed in network-manager:
status: Confirmed → Invalid
Revision history for this message
justen r meltz (justen) wrote :

not invalid!

Revision history for this message
Joakim Koed (vooze) wrote :

Justen: the invalid is just for the bug I reported upsteam. It is still marked as confirmed + high on ubuntu bugtracker.

Revision history for this message
messajunior (messajunior) wrote :

I guess Ubuntu 15.04 and 15.10 were affected by this bug too. By the way, is this a bug or not?

Revision history for this message
Joakim Koed (vooze) wrote :

It's not a bug. It's a new "feature" in network-manager from upstream.

no longer affects: unity-greeter (Ubuntu)
Changed in network-manager (Ubuntu):
status: Confirmed → Invalid
Revision history for this message
TenLeftFingers (tenleftfingers) wrote :

Another use case is that some of my directories are on cloud storage and mounted at login. With wifi initially unavailable this breaks applications that were expecting configs etc to be present.

Revision history for this message
Joakim Koed (vooze) wrote :

TenLeftFingers just turn it on? It's right in the settings.

Revision history for this message
TenLeftFingers (tenleftfingers) wrote :

I'm responding to Sebastien's comment on usecases here: https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/1574020/comments/35

The question is about the default setting for this and I would encourage connections the user has established in the session to be available and auto-connected from the greeter so that remote shares can be mounted at login for apps that need them, for example.

Revision history for this message
Rocko (rockorequin) wrote :

Another use case for allowing connections from lightdm is where Ubuntu won't boot into a desktop (it happens!) and you want to switch to a tty console and access the internet (eg to run upgrades) but you have no ethernet card. In this case it's a huge pain if you can't connect to the wireless network from lightdm.

Revision history for this message
Joakim Koed (vooze) wrote :

Rocko: you can still do it? You just have to enable it for all users.

Revision history for this message
corrado venturini (corradoventu) wrote :

modolo: Thanks from me too! This fixes the problem!
Note wifi was already working on same laptop, different fresh installations on different partitions Ubuntu 14.04, 1610, 17.04

Revision history for this message
Kristoffer Grundström (umeaman) wrote :

I see this error all the way up to Ubuntu 17.10 as well.

No fix for this coming yet?

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

Other bug subscribers

Bug attachments

Remote bug watches

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