linux-app icon indicating copy to clipboard operation
linux-app copied to clipboard

App hangs on connection

Open joshbowyer opened this issue 3 years ago • 28 comments

When clicking Quick Connect, the vpn connection is established but the interface is stuck on Connecting with the waiting circle animation going indefinitely.

Debian Bullseye aarch64

Also, does the Kill Switch functionality work if the app is closed but libindicator is not used (such as when using a desktop environment that does not implement it, like Phosh)?

joshbowyer avatar Jun 21 '21 15:06 joshbowyer

Hey @joshbowyer

Does the issue persist after the latest update ? Also, in regards to the kill switch yes that is correct. When you don't have libindicator installed, when you press on the X the app actually ends, but the permanent Kill Switch remains in its place.

calexandru2018 avatar Jun 23 '21 07:06 calexandru2018

So it looks like it just fails to connect. It creates the three network devices (*intfr0) but after a while the connecting screen eventually just shows a Close button and returns to the main screen which still says not connected, and I have no network connectivity.

joshbowyer avatar Jun 23 '21 14:06 joshbowyer

Hey @joshbowyer please ensure you're running on the latest versions.

calexandru2018 avatar Jun 23 '21 14:06 calexandru2018

I am. I just updated this morning from the official repo.

joshbowyer avatar Jun 23 '21 14:06 joshbowyer

Are there logs I can check? Or does it just bootstrap NetworkManager?

joshbowyer avatar Jun 25 '21 13:06 joshbowyer

Hey @joshbowyer

You can check the logs via the following commands:

  • journalctl -eu NetworkManager
  • cd ~/.cache/protonvpn/logs && ls -la then you can choose which files you would like to look at

If you don't manage to figure it out, you're more then welcome to reach out to our incredible support team at: https://protonvpn.com/support-form which will help you out.

calexandru2018 avatar Jun 28 '21 08:06 calexandru2018

The following appears to be the issue:

protonvpn.log:2021-06-23 09:04:47,899 — nm_client_mixin.py — ERROR — __dynamic_callback:124 — Exception: NM.Client.add_connection_finish() takes exactly 2 arguments (1 given) protonvpn.log:2021-06-23 09:04:47,967 — nm_client_mixin.py — ERROR — __dynamic_callback:124 — Exception: NM.Client.activate_connection_finish() takes exactly 2 arguments (1 given) protonvpn.log:2021-06-23 09:08:48,276 — monitor_vpn_connection_start.py — ERROR — on_vpn_state_changed:101 — State: VPNConnectionStateEnum.FAILED ; ReasonVPNConnectionReasonEnum.UNKNOWN_ERROR ; Message: ProtonVPN connection failed due to unknown reason.

The following might be a result of the above but posting it for posterity:

protonvpn-daemon.log:2021-06-23 08:44:29,894 — dbus_daemon_reconnector.py — ERROR — manually_start_vpn_conn:272 — Unknown reconnector error: Expected a string or unicode object. protonvpn-dbus-wrapper.log:2021-06-23 08:44:26,947 — dbus_network_manager_wrapper.py — ERROR — get_vpn_interface:306 — [!] Could not find interface belonging to 'proton0'. protonvpn-dbus-wrapper.log:2021-06-23 08:44:29,844 — dbus_network_manager_wrapper.py — ERROR — get_active_connection:349 — org.freedesktop.DBus.Error.UnknownMethod: No such interface “org.freedesktop.DBus.Properties” on object at path /org/freedesktop/NetworkManager/ActiveConnection/27

joshbowyer avatar Jun 28 '21 14:06 joshbowyer

Hey @joshbowyer please provide also the output of journalctl -eu NetworkManager

calexandru2018 avatar Jul 07 '21 14:07 calexandru2018

https://pastebin.com/Zazx6Fqh

joshbowyer avatar Jul 07 '21 14:07 joshbowyer

Got a few new lines after trying again after a reboot.

Jul 07 10:04:35 mobian NetworkManager[687]: [1625670275.1629] device (pvpnroutintrf0): state change: ip-config -> ip-check (reason 'none', sys-iface-state: 'managed') Jul 07 10:04:35 mobian NetworkManager[687]: [1625670275.1822] device (pvpnroutintrf0): state change: ip-check -> secondaries (reason 'none', sys-iface-state: 'managed') Jul 07 10:04:35 mobian NetworkManager[687]: [1625670275.1837] device (pvpnroutintrf0): state change: secondaries -> activated (reason 'none', sys-iface-state: 'managed') Jul 07 10:04:35 mobian NetworkManager[687]: [1625670275.2102] device (pvpnroutintrf0): Activation: successful, device activated. Jul 07 10:04:35 mobian NetworkManager[687]: [1625670275.6898] device (pvpnksintrf0): state change: activated -> deactivating (reason 'user-requested', sys-iface-state: 'managed') Jul 07 10:04:35 mobian NetworkManager[687]: [1625670275.7007] audit: op="connection-deactivate" uuid="27795c5a-a5a8-4aba-906f-a582f9c32f42" name="pvpn-killswitch" pid=1560 uid=1000 result="success" Jul 07 10:04:35 mobian NetworkManager[687]: [1625670275.7414] device (pvpnksintrf0): state change: deactivating -> disconnected (reason 'user-requested', sys-iface-state: 'managed') Jul 07 10:04:35 mobian NetworkManager[687]: [1625670275.7720] device (pvpnksintrf0): set-hw-addr: reset MAC address to BE:01:D1:5A:D0:78 (deactivate) Jul 07 10:04:35 mobian NetworkManager[687]: [1625670275.8115] policy: set 'REDACTED_WIFI' (wlan0) as default for IPv4 routing and DNS Jul 07 10:04:35 mobian NetworkManager[687]: [1625670275.9422] audit: op="connection-add" uuid="545b060d-4faa-43b6-b589-eb5bc6fa3586" name="ProtonVPN US-IL#31" pid=1560 uid=1000 result="success" Jul 07 10:04:36 mobian NetworkManager[687]: [1625670276.0211] device (pvpnksintrf0): state change: disconnected -> unmanaged (reason 'user-requested', sys-iface-state: 'managed') Jul 07 10:04:36 mobian NetworkManager[687]: [1625670276.2054] audit: op="connection-activate" uuid="545b060d-4faa-43b6-b589-eb5bc6fa3586" name="ProtonVPN US-IL#31" pid=1560 uid=1000 result="success" Jul 07 10:04:36 mobian NetworkManager[687]: [1625670276.2444] vpn-connection[0x55a594c2e0,545b060d-4faa-43b6-b589-eb5bc6fa3586,"ProtonVPN US-IL#31",0]: Started the VPN service, PID 2059 Jul 07 10:04:36 mobian NetworkManager[687]: [1625670276.2947] vpn-connection[0x55a594c2e0,545b060d-4faa-43b6-b589-eb5bc6fa3586,"ProtonVPN US-IL#31",0]: Saw the service appear; activating connection Jul 07 10:05:18 mobian NetworkManager[687]: [1625670318.1026] dhcp4 (ipv6leakintrf0): request timed out Jul 07 10:05:18 mobian NetworkManager[687]: [1625670318.1029] dhcp4 (ipv6leakintrf0): state changed unknown -> timeout Jul 07 10:08:36 mobian NetworkManager[687]: [1625670516.4009] vpn-connection[0x55a594c2e0,545b060d-4faa-43b6-b589-eb5bc6fa3586,"ProtonVPN US-IL#31",0]: Failed to request VPN secrets #3: No agents were available for this request. Jul 07 10:08:36 mobian NetworkManager[687]: [1625670516.4434] vpn-connection[0x55a594c2e0,545b060d-4faa-43b6-b589-eb5bc6fa3586,"ProtonVPN US-IL#31",0]: VPN service disappeared Jul 07 10:08:37 mobian NetworkManager[687]: [1625670517.4484] audit: op="connection-delete" uuid="27795c5a-a5a8-4aba-906f-a582f9c32f42" name="pvpn-killswitch" pid=2323 uid=1000 result="success" Jul 07 10:08:37 mobian NetworkManager[687]: [1625670517.9907] device (pvpnroutintrf0): state change: activated -> deactivating (reason 'connection-removed', sys-iface-state: 'managed') Jul 07 10:08:38 mobian NetworkManager[687]: [1625670518.0199] audit: op="connection-delete" uuid="a7155836-26eb-46a7-a288-d16365cafd18" name="pvpn-routed-killswitch" pid=2327 uid=1000 result="success" Jul 07 10:08:38 mobian NetworkManager[687]: [1625670518.1627] audit: op="connection-delete" uuid="545b060d- 4faa-43b6-b589-eb5bc6fa3586" name="ProtonVPN US-IL#31" pid=1560 uid=1000 result="success" Jul 07 10:08:38 mobian NetworkManager[687]: [1625670518.1841] device (pvpnroutintrf0): state change: deactivating -> disconnected (reason 'connection-removed', sys-iface-state: 'managed') Jul 07 10:08:38 mobian NetworkManager[687]: [1625670518.2794] device (pvpnroutintrf0): set-hw-addr: reset MAC address to 2A:E8:FF:15:45:C2 (deactivate) Jul 07 10:08:38 mobian NetworkManager[687]: [1625670518.3824] device (pvpnroutintrf0): state change: disconnected -> unmanaged (reason 'user-requested', sys-iface-state: 'managed') Jul 07 10:08:38 mobian NetworkManager[687]: [1625670518.4671] dns-sd-resolved[0f86e58b4ee27325]: send-updates SetLinkDomains@15 failed: GDBus.Error:org.freedesktop.resolve1.NoSuchLink: Link 15 not known Jul 07 10:08:38 mobian NetworkManager[687]: [1625670518.8483] device (ipv6leakintrf0): state change: activated -> deactivating (reason 'connection-removed', sys-iface-state: 'managed') Jul 07 10:08:38 mobian NetworkManager[687]: [1625670518.8668] audit: op="connection-delete" uuid="6a072341-25f6-4ac0-84e6-a90e267b7345" name="pvpn-ipv6leak-protection" pid=2353 uid=1000 result="success" Jul 07 10:08:38 mobian NetworkManager[687]: [1625670518.9243] device (ipv6leakintrf0): state change: deactivating -> disconnected (reason 'connection-removed', sys-iface-state: 'managed') Jul 07 10:08:38 mobian NetworkManager[687]: [1625670518.9488] dhcp4 (ipv6leakintrf0): canceled DHCP transaction Jul 07 10:08:38 mobian NetworkManager[687]: [1625670518.9490] dhcp4 (ipv6leakintrf0): state changed timeout -> done Jul 07 10:08:38 mobian NetworkManager[687]: [1625670518.9581] device (ipv6leakintrf0): set-hw-addr: reset MAC address to 0E:52:00:BE:12:73 (deactivate) Jul 07 10:08:39 mobian NetworkManager[687]: [1625670519.0351] device (ipv6leakintrf0): state change: disconnected -> unmanaged (reason 'user-requested', sys-iface-state: 'managed') Jul 07 10:08:39 mobian NetworkManager[687]: [1625670519.0425] dns-sd-resolved[0f86e58b4ee27325]: send-updates SetLinkDomains@13 failed: GDBus.Error:org.freedesktop.resolve1.NoSuchLink: Link 13 not known

joshbowyer avatar Jul 07 '21 15:07 joshbowyer

This seems to be the issue: Jul 07 09:27:50 mobian NetworkManager[687]: <error> [1625668070.2668] vpn-connection[0x55acdae110,ec7217bf-bd93-4a1c-82cb-67204a8d3474,"ProtonVPN US-IL#39",0]: Failed to request VPN secrets #3: No agents were available for this request. Jul 07 10:08:36 mobian NetworkManager[687]: [1625670516.4009] vpn-connection[0x55a594c2e0,545b060d-4faa-43b6-b589-eb5bc6fa3586,"ProtonVPN US-IL#31",0]: Failed to request VPN secrets #3: No agents were available for this request.

calexandru2018 avatar Jul 07 '21 15:07 calexandru2018

That stuck out to me too, but what is causing that? I have an initialized keychain

joshbowyer avatar Jul 07 '21 15:07 joshbowyer

By noagents it can be multiple things. Either something is miss-configured or nm-applet is missing, or that the specific plugin of NM is custom made and results in undesirable effects, something very similar to this: https://manual.lubuntu.me/stable/G/AdvancedNetworking.html

calexandru2018 avatar Jul 07 '21 16:07 calexandru2018

nm-applet is indeed missing (as this isn't a shell that uses applets).

Can this be changed? Maybe a simple conditional to check which shell is being used or something? And to ignore/continue if it's a shell without applets (phosh for example)?

joshbowyer avatar Jul 07 '21 18:07 joshbowyer

@joshbowyer it's a dependency for NetworkManager to work properly.

Could you try the following:

  • Download .ovpn file from your account: https://account.protonvpn.com/
  • Import it into NM via either NM-CLI or NM-GUI
  • FIll in the openvpn data
  • Select "Store password for this user only"
  • Save the VPN connection
  • Attempt to connect
  • Provide feedback

calexandru2018 avatar Jul 08 '21 07:07 calexandru2018

The connection works either way.

joshbowyer avatar Jul 08 '21 15:07 joshbowyer

Hello,

I have the same issue because I am using nmtui instead of nm-applet to manage my connections. If I run nm-applet, connection start as expected. But I would really like to use only nmtui, do you think it is possible to do so ?

Let me know if I need to open a new issue.

Thanks for your help !

regazzoj avatar Jul 13 '21 20:07 regazzoj

I suspect protonvpn needs nm-applet and a notification server. When I start np-applet with notifications disabled (nm-applet --no-agent), protonvpn hangs during the connection. For me, enabling notifications (taking out the --no-agent flag and having a server) fixes the problem.

foxfriday avatar Jul 28 '21 05:07 foxfriday

Well the agent is needed mostly for NM because the openvpn password is stored in the keyring. Some versions of nm-applet implement this while others dont (Lubuntu and the nm-tray problem), specifically:

One thing to consider is that nm-tray does not support password asking, so either you save the password FOR ALL USERS or you will need to connect differently.

And this is key here, since the "store password only for this user" won't work on lubuntu systems that use the native nm-tray because NM will need to ask keyring for the password, thus users wanting to use our app will need to switch to nm-applet.

As an example, I'm running Manjaro with Gnome (5.10.42-1-MANJARO) and I don't have the network-manager-applet package installed. Currently, nm related packages installed on my system are:

  • nm-connection-editor <- allows to edit VPN configs via GUI
  • libnm <- network manager library
  • libnma <- network manager GUI library
  • networkmanager and it's different vpn plugins
  • glib-networking <- network extension for Glib (manage NM via glib)

calexandru2018 avatar Jul 28 '21 09:07 calexandru2018

I have all the Debian equivalents of those installed but it doesnt work.

Did you see the error log I posted here showing an incorrect amount of arguments?

joshbowyer avatar Jul 28 '21 15:07 joshbowyer

@joshbowyer if you referring to

__dynamic_callback:124 — Exception: NM.Client.add_connection_finish() takes exactly 2 arguments (1 given)

Then it's most probably not the cause. If this was the cause then the results would've been different. Either way this has been fixed, and should ship with next update.

calexandru2018 avatar Jul 28 '21 15:07 calexandru2018

I'm having a related issue (#9). I use KDE and by default this nm-applet is not running. Protonvpn fails to connect unless I explicitly start nm-applet.

Has the dependency to nm-applet been removed?

amanzag avatar Aug 27 '21 09:08 amanzag

So we have to explicitly run nm-applet in an additional window every time we want to connect? Isn't there a workaround where nm-applet can automaticaly run in the background?...

zerotobtc avatar Sep 30 '21 05:09 zerotobtc

Bumping, would it be possible to simply check for nm-applet and if its not present to connect without it? That way if its present the functionality isnt removed but if its not then it doesnt fail

joshbowyer avatar Oct 29 '21 13:10 joshbowyer

Bumping again, the app is currently unusable without nm-applet and many distros now dont ship with it

joshbowyer avatar Nov 19 '21 16:11 joshbowyer

Is the connection established on the second try?

ediowar avatar Dec 14 '21 23:12 ediowar

Nope

joshbowyer avatar Dec 14 '21 23:12 joshbowyer

similar issue also on manjaro kde. latest protonvpn version

Excal-rs avatar Jan 18 '22 18:01 Excal-rs