ProtonVPN / linux-cli

Official ProtonVPN Linux app (CLI)
https://protonvpn.com/download-linux
GNU General Public License v3.0
339 stars 44 forks source link

"No session was found. Please login first." directly after logging in #7

Closed RudiAusBuddeln closed 3 years ago

RudiAusBuddeln commented 3 years ago
$ protonvpn-cli login "address"
Enter your ProtonVPN password:

Successful login.
$ protonvpn-cli c

No session was found. Please login first.

I am using the AUR version on Arch and well, it doesn't seem to save the login details.

ProtonVPN CLI v3.6.0 (protonvpn-nm-lib v3.2.0; proton-client v0.5.1)

savagebread commented 3 years ago

Having the same issue on Ubuntu Server 20.04.2 ProtonVPN CLI v3.6.0 (protonvpn-nm-lib v3.2.1; proton-client v0.5.1)

calexandru2018 commented 3 years ago

Hey @RudiAusBuddeln

Could you check the logs for the symptoms ? Also, you should also find which keyring backend you're using.

RudiAusBuddeln commented 3 years ago

An error is reported in ~/.cache/protonvpn/logs/protonvpn.log:

2021-06-11 16:32:18,790 — settings_backend.py — INFO — get_backend:13 — Settings backend: <class 'protonvpn_nm_lib.core.user_settings.default_settings_backend.Settings'>
2021-06-11 16:32:21,429 — utilities.py — INFO — ensure_internet_connection_is_available:21 — Checking for internet connectivity
2021-06-11 16:32:21,433 — killswitch.py — INFO — __init__:60 — Initialized killswitch manager
2021-06-11 16:32:21,435 — killswitch.py — INFO — check_status_connectivity_check:523 — Conn check available (1) - Conn check enabled (1)
2021-06-11 16:32:21,435 — utilities.py — INFO — ensure_internet_connection_is_available:23 — Skipping as killswitch is enabled
2021-06-11 16:32:21,435 — utilities.py — INFO — ensure_api_is_reacheable:46 — Checking API connectivity
2021-06-11 16:32:21,435 — utilities.py — INFO — ensure_api_is_reacheable:49 — Skipping as killswitch is enabled
2021-06-11 16:32:22,233 — session.py — INFO — servers:484 — Could not load server cache
2021-06-11 16:32:22,745 — session.py — INFO — clientconfig:544 — Could not load client config cache
2021-06-11 16:32:25,497 — settings_backend.py — INFO — get_backend:13 — Settings backend: <class 'protonvpn_nm_lib.core.user_settings.default_settings_backend.Settings'>
2021-06-11 16:32:25,545 — session.py — ERROR — __init__:176 — 'NoneType' object has no attribute 'get'
Traceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/protonvpn_nm_lib/core/session/session.py", line 171, in __init__
    self.__keyring_load_session()
  File "/usr/lib/python3.9/site-packages/protonvpn_nm_lib/core/session/session.py", line 212, in __keyring_load_session
    if keyring_data.get('api_url') != self.__proton_api.dump()['api_url']:
AttributeError: 'NoneType' object has no attribute 'get'

The protonvpn-cli.log:

2021-06-11 16:32:18,788 — cli.py — INFO — __init__:39 — 
-------------------------------------------------

----------- Initialized protonvpn-cli   -----------

-------------------------------------------------
2021-06-11 16:32:18,788 — cli.py — INFO — __init__:51 — ProtonVPN CLI v3.6.0 (protonvpn-nm-lib v3.2.0; proton-client v0.5.1)
2021-06-11 16:32:18,788 — cli.py — INFO — __init__:57 — CLI command: Namespace(command='login', version=False, help=False)
2021-06-11 16:32:21,429 — cli_wrapper.py — INFO — login:68 — Credentials provided, attempting to login
2021-06-11 16:32:25,496 — cli.py — INFO — __init__:39 — 
-------------------------------------------------

----------- Initialized protonvpn-cli   -----------

-------------------------------------------------
2021-06-11 16:32:25,496 — cli.py — INFO — __init__:51 — ProtonVPN CLI v3.6.0 (protonvpn-nm-lib v3.2.0; proton-client v0.5.1)
2021-06-11 16:32:25,496 — cli.py — INFO — __init__:57 — CLI command: Namespace(command='c', version=False, help=False)
2021-06-11 16:32:25,498 — cli.py — INFO — connect:120 — Options: Namespace(servername=None, fastest=True, random=False, cc=None, sc=False, p2p=False, tor=False, protocol=None, help=False)

I haven't done much with keyrings, but I assume I am using the archlinux-keyring. I don't know whether this might be helpful:

$ keyring --list-backends
keyring.backends.fail.Keyring (priority: 0)
keyring.backends.chainer.ChainerBackend (priority: -1)
calexandru2018 commented 3 years ago

Hey @RudiAusBuddeln

Thank you for the keyring --list-backends command output as it was very useful. Our library is dependent on either kwallet or secret-service (aka gnome-keyring). This is mostly so because NetworkManager works best with these two keyring backend and also because of the limitation of the python-keyring package. This is actually mentioned on our webpage: https://protonvpn.com/support/linux-vpn-tool/

Could you please logout and login and provide me with the logs ? Or maybe even better contact support at the following link: https://protonvpn.com/support-form

RudiAusBuddeln commented 3 years ago

Alright, I have installed gnome-keyring and it the login works now. You are aware that you can offer a mutually exclusive option list for a package with pacman? Like Choose a provider: kwallet, gnome-keyring.

The only problem is that I have the No agents found error now, though.

mkelzeer commented 3 years ago

@calexandru2018 @RudiAusBuddeln I have the same problem, gnome-keyring is installed already. Ubuntu 20.04. Any idea what can I do?