ProtonVPN / linux-cli

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

Cannot login with protonvpn-cli #32

Closed ghost closed 3 years ago

ghost commented 3 years ago

When I try to login to the cli with protonvpn-cli login <username> I get this output:

Traceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/protonvpn_nm_lib/core/keyring/linuxkeyring.py", line 21, in __getitem__
    stored_data = self.__keyring_backend.get_password(
  File "/usr/lib/python3.9/site-packages/keyring/backends/SecretService.py", line 78, in get_password
    collection = self.get_preferred_collection()
  File "/usr/lib/python3.9/site-packages/keyring/backends/SecretService.py", line 67, in get_preferred_collection
    raise KeyringLocked("Failed to unlock the collection!")
keyring.errors.KeyringLocked: Failed to unlock the collection!

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/protonvpn-cli", line 33, in <module>
    sys.exit(load_entry_point('protonvpn-cli==3.7.1', 'console_scripts', 'protonvpn-cli')())
  File "/usr/lib/python3.9/site-packages/protonvpn_cli/main.py", line 21, in main
    ProtonVPNCLI()
  File "/usr/lib/python3.9/site-packages/protonvpn_cli/cli.py", line 63, in __init__
    getattr(self, args.command)()
  File "/usr/lib/python3.9/site-packages/protonvpn_cli/cli.py", line 159, in login
    self.cli_wrapper.login(args.username)
  File "/usr/lib/python3.9/site-packages/protonvpn_cli/cli_wrapper.py", line 63, in login
    if self.protonvpn.check_session_exists():
  File "/usr/lib/python3.9/site-packages/protonvpn_nm_lib/api.py", line 321, in check_session_exists
    return self._env.api_session.is_valid
  File "/usr/lib/python3.9/site-packages/protonvpn_nm_lib/core/environment.py", line 53, in api_session
    self.__api_session = APISession()
  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 195, in __keyring_load_session
    keyring_data_user = ExecutionEnvironment().keyring[
  File "/usr/lib/python3.9/site-packages/protonvpn_nm_lib/core/keyring/linuxkeyring.py", line 32, in __getitem__
    raise exceptions.KeyringError(e)
protonvpn_nm_lib.exceptions.KeyringError: Failed to unlock the collection!

I'm not sure what's causing this problem, I've done a little research but I couldn't find anything that helped fix it. I also tried rebooting (that's a classic solution). My operating system is Arch Linux and my ProtonVPN version is: ProtonVPN CLI v3.7.1 (protonvpn-nm-lib v3.3.1; proton-client v0.5.1)

ghost commented 3 years ago

I solved the issue, it was caused by a problem with creating the keyring. I fixed it by adding source /etc/X11/xinit/xinitrc.d/50-systemd-user.sh to my .xinitrc file, and then logging out and back in.

BartoszBartmanski commented 1 year ago

I have the same error, but the posted solution does not work for me, as I don't have the etc/X11/xinit/xinitrc.d/50-systemd-user.sh file. Are there any other solutions to this issue?

stephanemoulec commented 1 year ago

I am running into the same issue with protonvpn-cli v3.13.0 (protonvpn-nm-lib v3.14; proton-client v0.7.1) on UbuntuSway. I don't have and /etc/X11/xinit either (Sway uses Wayland, not Xorg) Everything I read says protonvpn-cli is not a true command line tool but requires gnome network manager... Go figure... Anyone smarter than me out there who figured it out?