Bug 326134 - All passphrases lost or ignored
Summary: All passphrases lost or ignored
Status: RESOLVED WORKSFORME
Alias: None
Product: plasma-nm
Classification: Plasma
Component: general (show other bugs)
Version: 0.9.3.1
Platform: Arch Linux Linux
: NOR critical
Target Milestone: ---
Assignee: Lukáš Tinkl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-17 12:08 UTC by gene c
Modified: 2013-11-14 10:25 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description gene c 2013-10-17 12:08:39 UTC
Worked fine for a day or so - now all passwords have gone. Connecting to known SSID's now asks for password. Indeed the connection editor has the SSID's but all passwords are no longer visible until i create new ones.

This is really bad. How do i recover the many many passwords that have been working fine for many years until this new applet came online?

Thanks.

Also - for logging to .xsession-errors - please add a date/time stamp. too much noise in that file.

Reproducible: Always

Steps to Reproduce:
1. Install app
2. Use it
3. 
Actual Results:  
Now prompts for passphrase

Expected Results:  
Use already stored passphrase
Comment 1 gene c 2013-10-17 12:13:43 UTC
Arch package version:  kdeplasma-applets-plasma-nm 0.9.3.1-2
Comment 2 gene c 2013-10-17 12:28:42 UTC
 I can still see previous passphrases in the directory:

~/.kde4/share/apps/networkmanagement/secrets

  Since nothing in that dir is recently dated I would assume the app is no longer looking in that dir and is now looking somewhere else - or the connection between the 'secrets' and the SSID has been lost somehow. 

This might also be an Arch packaging issue.
Comment 3 Jan Grulich 2013-10-17 12:34:53 UTC
You are  probably not using KWallet. The problem is that the old applet uses storing secrets into multiple files to networkmanagement directory and we are storing it differently. Only password stored into KWallet from previous applet works correctly in the new one. Also we are using KWallet by default, because it's more secure and it's not possible to force not using KWallet when it's enabled.
Comment 4 gene c 2013-10-17 12:40:13 UTC
I am not using kwallet. I have 70 secrets files - are you saying I have to re-enter these all by hand or is this there some tool to do this?  That is a pretty mean thing to do to your users :(

What about connections which are marked to be available to all users?? Where are they stored? Are those  independent of kwallet? Is there a way to push the old secrets file to be available to all users as a work around to save all the passphrases?
Comment 5 Jan Grulich 2013-10-17 12:51:44 UTC
As workaround you can mark all connections as system connections (but you have to do it in the old applet). Then all the connections (with secrets) will be stored in /etc/NetworkManager/system-connections and available for the new applet.
Comment 6 gene c 2013-10-17 12:59:44 UTC
thanks jan - i wonder if it's possible to write a small python script to read the secrets files (which don't seem to have the SSID) - find the associated SSID and create the correct network manager files. My directory

~/.kde4/share/apps/networkmanagement/connections

is now empty - so where does the old network app store the SSID's so it can associate the correct secret file? Knowing this it ought to be doable to just write a script to do the right thing.
Comment 7 gene c 2013-10-17 13:25:28 UTC
Since my kwallet is not enabled - where is the applet now storing the passphrases?  At least the button labeled 'enable wallet subsystem' is not checked. I recall not wanting to have to enter a password every time I use the wifi network being one reason i went with files.
Comment 8 Jan Grulich 2013-10-17 13:59:13 UTC
Connection settings (i.e uuid, ssid, connection name) are stored by NetworkManager and I don't remember where. If your connections are system connection, then they are stored in by NetworkManager even with your passwords.
Comment 9 Jan Grulich 2013-10-17 14:01:19 UTC
It's in /etc/sysconfig/network-scripts/icfg-*. But you should be now able to see your connections with secrets in the new applet's editor.
Comment 10 gene c 2013-10-17 21:31:58 UTC
thank you for your thoughts and comments.

i can see the connections in the new applet editor but the secrets are not picked up any longer- it would be nice if it picked them up from the old kde secrets directory. I did not have system wide ones - that seems to have been a bad choice sadly. 

for system connections Network manager (on my system anyway) stores all the info in /etc/NetworkManager/system-connections

For non system connections I cannot find where the old applet is storing the info ... tried ~/.config and ~/.kde4 ... all i have (as of now) are the passphrases in the secrets files. 

For that matter - where is this new applet storing the connection info and passwords? I am pretty sure my kwallet is disabled.

I guess I will by hand convert all to system connections - and somehow edit in all the passphrases ...

This is quite a step backwards for something that has needed zero attention for many years and now we have broken backward compatibility - making the users fix the mess seems like an imperfect way forward - in my view anyway - and mostly coz I am a user :-)

Anyway thank you for your help.
Comment 11 gene c 2013-10-18 00:11:42 UTC
Sigh - the edit connections window is broken. Some are editable and some when I click the option for all users may connect - the 'ok' button remains grayed out so cannot be saved. Some can some cannot. I do see the file named by SSID in the /etc/NetworkManager/system-connections directory and all permissions are identical (owned and rw by root). So that doesn't explain why some are editable and some are not.
Comment 12 gene c 2013-10-18 00:24:10 UTC
Just selecting 'allow all users' is not always enough to be saved. Changing the password seems to make it savable ...
Comment 13 Jan Grulich 2013-10-18 09:00:00 UTC
In the new applet the secrets are saved into ~/.kde/share/config/plasma-networkmanagement and they are stored in this format: 
[connection_uuid;connection_type]
password=foo
i.e
[8fd01ef9-e165-45dd-9027-8bad82638f51;802-11-wireless-security]
wepkey0=xxxxxx
Comment 14 gene c 2013-10-18 12:40:16 UTC
Thanks - should be pretty straightforward to write a converter script to your applet file (not sure about 802.-11.1x tho) from the files 

~/.kde4/share/apps/networkmanagement/secrets/
which are in format: filename={uuid}
contents looking like:
[802-11-wireless-security]
psk=xxx

In the mean time I have hand converted all my connections to system wide and added the passkeys to the NetworkManager connection files in

/etc/NetworkManager/system-connections/

This can be done in the applet interface or just edit the files -  removing the permissions line containing user(s) and adding psk=xxx to the [802-11-wireless-security] stanza.

By the way is there a reason that the nm-applet uses a slightly different file format to NetworkManager itself? Which is 1 file per UUID named by UUID and then having uuid=inside the file etc.

Might be good to document (outside this bug report) how users can recover their passkeys after they convert to this new applet.
Comment 15 Florian 2013-10-30 20:15:51 UTC
On Arch linux there is no possibility to store any connection. Either edited or omported, after clicking "Ok" the list still stays empty :-(
Comment 16 Florian 2013-10-30 20:16:36 UTC
(In reply to comment #15)
> On Arch linux there is no possibility to store any connection. Either edited
> or omported, after clicking "Ok" the list still stays empty :-(

*imported
Comment 17 Nikita Skovoroda 2013-11-07 17:03:36 UTC
> On Arch linux there is no possibility to store any connection. Either edited or omported, after clicking "Ok" the list still stays empty :-(

My system (on Arch Linux) is also affected by this bug.

kdeplasma-applets-plasma-nm 0.9.3.1-3 does not try to open kwallet when it's closed, it does not load secrets from kwallet (both older «Network Management» and newer «plasma-nm» categories) neither does it save secrets to kwallet.
Comment 18 Nikita Skovoroda 2013-11-07 17:05:48 UTC
Entering secrets once in network connection properties and pressing «ok» works for a single time:  NM uses that secret to establish the connection once, but it's not saved for future use.
Comment 19 Jan Grulich 2013-11-07 18:17:51 UTC
KWallet is opened automatically only when it's not disabled in system, I just tried it and it worked as expected.
Comment 20 Nikita Skovoroda 2013-11-07 19:07:05 UTC
It does not for me after the update.
Comment 21 Jan Grulich 2013-11-07 20:21:42 UTC
After the update to 0.9.3.1 version of after the update from the old applet?
Comment 22 Nikita Skovoroda 2013-11-07 20:50:04 UTC
[2013-11-07 00:49] [PACMAN] Running '/usr/bin/pacman -S libnm-qt kdeplasma-applets-plasma-nm'
[2013-11-07 00:49] [PACMAN] removed kdeplasma-applets-networkmanagement (1:0.9.0.9-1)
[2013-11-07 00:49] [PACMAN] downgraded libnm-qt (1a1bda4-1 -> 0.9.0.1-1)
[2013-11-07 00:49] [PACMAN] downgraded kdeplasma-applets-plasma-nm (677.f4cf239-1 -> 0.9.3.1-3)

I was using  kdeplasma-applets-plasma-nm 677.f4cf239-1 (ignore the «downgraded» string), kdeplasma-applets-networkmanagement (1:0.9.0.9-1) was installed, but not enabled.
Comment 23 Jan Grulich 2013-11-07 21:03:09 UTC
I see you upgraded today, I guess there will be some problem in kded module. If you didn't restart your computer after the upgrade, you are running the old kded module and that's why it doesn't work.
Comment 24 Nikita Skovoroda 2013-11-07 21:31:34 UTC
I did restart my computer, that's not the source of the problem.
Comment 25 Jan Grulich 2013-11-07 21:51:37 UTC
Well, I don't see any potential problem in plasma-nm and because you said the same problem was with the previous applet, then I guess it's not in plasma-nm.
Comment 26 Nikita Skovoroda 2013-11-07 22:08:57 UTC
Where exactly did I say that? Everything was working fine before the update.
Comment 27 Nikita Skovoroda 2013-11-07 22:16:39 UTC
NetworkManager logs:

NetworkManager[26627]: <info> Activation (wlp2s0) Stage 2 of 5 (Device Configure) starting...
NetworkManager[26627]: <info> (wlp2s0): device state change: prepare -> config (reason 'none') [40 50 0]
NetworkManager[26627]: <info> Activation (wlp2s0/wireless): access point 'C_NET-M' has security, but secrets are required.
NetworkManager[26627]: <info> (wlp2s0): device state change: config -> need-auth (reason 'none') [50 60 0]
NetworkManager[26627]: <debug> [1383862317.16260] [nm-agent-manager.c:1056] nm_agent_manager_get_secrets(): Secrets requested for connection /org/freedesktop/NetworkManager/Settings/11 (802-11-wireless-security)
NetworkManager[26627]: <debug> [1383862317.16292] [nm-settings-connection.c:864] nm_settings_connection_get_secrets(): (8b26a792-0474-4dde-b216-9c9613665602/802-11-wireless-security:2) secrets requested flags 0x5 hint '(null)'
NetworkManager[26627]: <info> Activation (wlp2s0) Stage 2 of 5 (Device Configure) complete.
NetworkManager[26627]: <debug> [1383862317.16406] [nm-settings-connection.c:663] agent_secrets_done_cb(): (8b26a792-0474-4dde-b216-9c9613665602/802-11-wireless-security:2) secrets request error: (6) No agents were available for this request.
NetworkManager[26627]: <warn> No agents were available for this request.
NetworkManager[26627]: <info> (wlp2s0): device state change: need-auth -> failed (reason 'no-secrets') [60 120 7]
NetworkManager[26627]: <info> NetworkManager state is now DISCONNECTED
NetworkManager[26627]: <info> Marking connection 'C_NET-M' invalid.
Comment 28 Nikita Skovoroda 2013-11-07 22:18:02 UTC
plasma logs (when trying to connect):

plasma-desktop(26520)/Plasma-nm (handler) Handler::activateConnection: Activating  "C_NET-M"  connection
NetworkManagerQt "plasma-desktop" ( 26520 ) QDBusPendingReply<QDBusObjectPath> NetworkManager::NetworkManagerPrivate::activateConnection(const QString&, const QString&, const QString&) : Activating connection "/org/freedesktop/NetworkManager/Settings/11" on interface "/org/freedesktop/NetworkManager/Devices/0" with extra "/org/freedesktop/NetworkManager/AccessPoint/251" 
void NetworkManager::NetworkManagerPrivate::propertiesChanged(const QVariantMap&) Unhandled property "ActivatingConnection" 
plasma-desktop(26520)/Plasma-nm (monitor) Monitor::activeConnectionAdded: Active connection  "C_NET-M"  added
NetworkManagerQt "plasma-desktop" ( 26520 ) void NetworkManager::NetworkManagerPrivate::propertiesChanged(const QVariantMap&) :    "/org/freedesktop/NetworkManager/ActiveConnection/28" 
plasma-desktop(26520)/Plasma-nm (applet) ConnectionIcon::setDisconnectedIcon: Emit signal setConnectionIcon(network-wireless-0)
plasma-desktop(26520)/Plasma-nm (monitor) Monitor::statusChanged: NetworkManager status changed to  4
plasma-desktop(26520)/Plasma-nm (monitor) Monitor::statusChanged: NetworkManager is not connected
plasma-desktop(26520)/Plasma-nm (applet) NetworkStatus::statusChanged: Emit signal setNetworkStatus( "Connecting" ,  false ,  true )
plasma-desktop(26520)/Plasma-nm (applet) NetworkStatus::statusChanged: Emit signal setNetworkStatus( "Connecting" ,  false ,  true )
plasma-desktop(26520)/Plasma-nm (applet) ConnectionIcon::setDisconnectedIcon: Emit signal setConnectionIcon(network-wireless-0)
void NetworkManager::NetworkManagerPrivate::propertiesChanged(const QVariantMap&) Unhandled property "ActivatingConnection" 
plasma-desktop(26520)/Plasma-nm (monitor) Monitor::activeConnectionRemoved: Active connection  "/org/freedesktop/NetworkManager/ActiveConnection/28" removed
plasma-desktop(26520)/Plasma-nm (applet) ConnectionIcon::setDisconnectedIcon: Emit signal setConnectionIcon(network-wireless-0)
plasma-desktop(26520)/Plasma-nm (monitor) Monitor::statusChanged: NetworkManager status changed to  2
plasma-desktop(26520)/Plasma-nm (monitor) Monitor::statusChanged: NetworkManager is not connected
plasma-desktop(26520)/Plasma-nm (applet) NetworkStatus::statusChanged: Emit signal setNetworkStatus( "Соединение разорвано" ,  false ,  false )
plasma-desktop(26520)/Plasma-nm (applet) NetworkStatus::statusChanged: Emit signal setNetworkStatus( "Соединение разорвано" ,  false ,  false )
plasma-desktop(26520)/Plasma-nm (applet) ConnectionIcon::setDisconnectedIcon: Emit signal setConnectionIcon(network-wireless-0)
plasma-desktop(26520)/Plasma-nm (applet) ConnectionIcon::setDisconnectedIcon: Emit signal setConnectionIcon(network-wireless-0)
plasma-desktop(26520)/plasma StatusNotifierItemSource::refreshCallback: DBusMenu disabled for this application
Comment 29 Jan Grulich 2013-11-07 22:21:47 UTC
Restart kded4 from console using "killall kded4 && kded4" and send me an output after you try to activate your connection. You should see something like that:
virtual NMVariantMapMap SecretAgent::GetSecrets(const NMVariantMapMap&, const QDBusObjectPath&, const QString&, const QStringList&, uint) 
Path: "/org/freedesktop/NetworkManager/Settings/5" 
Setting name: "802-11-wireless-security" 
Hints: () 
Flags: 4
Comment 30 Nikita Skovoroda 2013-11-07 22:55:04 UTC
Ok, thanks to Jan Grulich, this got solved during an IRC conversation.

The solution (at least for me) was:
$ qdbus org.kde.kded /kded org.kde.kded.setModuleAutoloading networkmanagement 1
$ qdbus org.kde.kded /kded org.kde.kded.loadModule networkmanagement

Another way: open systemsettings, services, enable «Plasma Networkmanagement module», select it and press «Start».

The cause of the problem was the fact that before version 0.9.3.1 the new applet had a different  kded module name from the old one, and they could be installed simultaneously in Archlinux. In such case most probably the old module was disabled, and the new module was enabled.
Starting from version 0.9.3.1 the new module was renamed to match the old module name, resulting in it getting disabled by the same setting that previously disabled the old module.
Without the kded module running, the SecretAgent didn't work.

Probably a warning has to be added in the Archlinux package.