Bug 807248

Summary: User connections get lost during upgrade
Product: [Fedora] Fedora Reporter: Christoph Wickert <christoph.wickert>
Component: NetworkManagerAssignee: Dan Williams <dcbw>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 17CC: danw, dcbw, jklimes
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-03-27 22:20:12 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Christoph Wickert 2012-03-27 11:10:40 UTC
Description of problem:
While upgrading from F15 to F17 branched all VPN settings got lost.

Version-Release number of selected component (if applicable):
NetworkManager-0.9.3.997-1.git20120321.fc17.x86_64
NetworkManager-glib-0.9.3.997-1.git20120321.fc17.x86_64
NetworkManager-gnome-0.9.3.997-1.git20120321.fc17.x86_64
NetworkManager-gtk-0.9.3.997-1.git20120321.fc17.x86_64
NetworkManager-openvpn-0.9.3.997-1.fc17.x86_64
NetworkManager-pptp-0.9.3.997-1.fc17.x86_64
NetworkManager-vpnc-0.9.3.997-1.fc17.x86_64

How reproducible:
always

Steps to Reproduce:
1. Have a F15 install
2. Configure some VPNs, e.g. PPTP or OpenVPN
3. Upgrade system to F17

Actual results:
No more VPN connections available.

Expected results:
Configured VPN connections should still be available. From 0.9.1.90 to 0.9.3.x or 0.9.4 is a minor upgrade, so there should be a clean upgrade path and no loss of configuration.

Additional info:
As Data loss is considered of high severity in bugzilla, I am setting severity accordingly.

Comment 1 Christoph Wickert 2012-03-27 11:11:31 UTC
BTW: Where is the configuration stored? Is there a way to restore it manually?

Comment 2 Jirka Klimes 2012-03-27 15:12:25 UTC
(In reply to comment #0)

> Configured VPN connections should still be available. From 0.9.1.90 to 0.9.3.x
> or 0.9.4 is a minor upgrade, so there should be a clean upgrade path and no
> loss of configuration.
> 
Was it really upgrade from 0.9.1.x to 0.9.3.x? Because there's no change in storing connections in latest version. And the migration would have been already done.

There was a major change between 0.8 and 0.9. NM 0.8 used 2 settings services, that provide connections to NM daemon - one was inside NM itself and handles system connections, the second was in nm-applet (user connections). The user connections were stored in GConf. You would find them in ~/.gconf/system/networking/connections. Or use gconf-editor /system/networking/connections.

The user connection are not used any more in 0.9 (they can be emulated) and only
one settings service exists.

http://projects.gnome.org/NetworkManager/developers/api/09/ref-migrating.html


The migration of stored data was done by nm-applet (src/applet.c by
nm_gconf_move_connections_to_system() function). And migration apps/nm-applet/stamp key in GConf is set to 3, marking the migration as done.
If you reset the stamp to 2 and run nm-applet it will force the migration again.

Comment 3 Christoph Wickert 2012-03-27 16:06:56 UTC
(In reply to comment #2)
> Was it really upgrade from 0.9.1.x to 0.9.3.x? 

Yes, it was from F15 to F17 branched. F15 was first release with GNOME 3 and therefor required NM 0.9.

> The user
> connections were stored in GConf. You would find them in
> ~/.gconf/system/networking/connections. Or use gconf-editor
> /system/networking/connections.

They are still there, I can see them on the harddrive or in gconf-editor, but not in nm-connection-editor.

While looking at the connections I realized it is not just VPN but also bluetooth and others, basically all user connections. nm-connection-editor only shows system-wide connections from /etc/sysconfig/networking-scripts

> The user connection are not used any more in 0.9 (they can be emulated) and
> only
> one settings service exists.

This cannot be true. Connections I added in 0.9/F15 were written to gconf - unless they were marked as system-wide connections.

Where are user connections stored in 0.9? gsettings?

> The migration of stored data was done by nm-applet (src/applet.c by
> nm_gconf_move_connections_to_system() function). And migration
> apps/nm-applet/stamp key in GConf is set to 3, marking the migration as done.
> If you reset the stamp to 2 and run nm-applet it will force the migration
> again.

Thanks, that brought me my VPN connections back. On the other hand it also brought ancient Wifi networks back which I had already deleted a while ago.

Comment 4 Christoph Wickert 2012-03-27 16:17:29 UTC
(In reply to comment #3)
> Where are user connections stored in 0.9? gsettings?

I just found them in /etc/sysconfig/networking-scripts.

I think there is fundamentally wrong here:
1. Connections should not be changed from private to public without user permission.
2. The migration should not just write random stuff to a /etc/sysconfig. This should still require root privileges.

Comment 5 Christoph Wickert 2012-03-27 16:22:55 UTC
One more thing I realized: The migration did not bring back an OpenVPN connection I added two weeks ago in F15. This indicates that by that time NM was already using the new configuration.

Comment 6 Dan Winship 2012-03-27 21:59:00 UTC
(In reply to comment #5)
> One more thing I realized: The migration did not bring back an OpenVPN
> connection I added two weeks ago in F15.

Right, it wasn't actually doing the right thing; your previous connections had been deleted, this was just a kludge recreating them from your old F14 state.

Oh. Hm... did you actually "upgrade" from F15 to F17, or did you reinstall? Since even user connections are stored in /etc now, if you did a reinstall, then they'd be lost, even if you had separately preserved /home.

Comment 7 Christoph Wickert 2012-03-27 22:20:12 UTC
You are right, I formatted my / partition. I found the connections I was looking for in my backup, copied them back and things are fine. Sorry for the noise.

I still think there is something wrong with the migration though. Old 0.8 user connections should not be migrated to 0.9 system-wide connections. But this is a different issue.

Comment 8 Dan Winship 2012-03-28 12:33:26 UTC
They're not migrated to system-wide connections, they're migrated to user-connections-that-are-stored-in-/etc (but still marked as being specific to a single user).

I don't really love that arrangement either, but that's how it is for now.