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

Root error on Linux Debian 11 / Auto-connect at startup after wifi connection #52

Closed samychkeit closed 2 years ago

samychkeit commented 2 years ago

Hello,

I installed ProtonVPN on Debian GNU/Linux 11 (bullseye) 64 bits with Gnome 3.38.5, and i cannot run the command to connect to the fastest secure core server "protonvpn-cli c --sc" in root - which is problematic to create a systemd service to automatically connect at startup when connected to wifi.

He sends me back when I try :

protonvpn-cli c --sc

Traceback (most recent call last): File "/usr/lib/python3/dist-packages/secretstorage/init.py", line 72, in dbus_init connection = open_dbus_connection() File "/usr/lib/python3/dist-packages/jeepney/io/blocking.py", line 255, in open_dbus_connection conn = DBusConnection(sock) File "/usr/lib/python3/dist-packages/jeepney/io/blocking.py", line 68, in init hello_reply = self.bus_proxy.Hello() File "/usr/lib/python3/dist-packages/jeepney/io/blocking.py", line 223, in inner return self._connection.send_and_get_reply( File "/usr/lib/python3/dist-packages/jeepney/io/blocking.py", line 134, in send_and_get_reply self.send_message(message, serial=serial) File "/usr/lib/python3/dist-packages/jeepney/io/blocking.py", line 83, in send self.sock.sendall(data) BrokenPipeError: [Errno 32] Broken pipe

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/usr/lib/python3/dist-packages/protonvpn_nm_lib/core/keyring/linuxkeyring.py", line 21, in getitem stored_data = self.keyring_backend.get_password( File "/usr/lib/python3/dist-packages/keyring/backends/SecretService.py", line 78, in get_password collection = self.get_preferred_collection() File "/usr/lib/python3/dist-packages/keyring/backends/SecretService.py", line 56, in get_preferred_collection bus = secretstorage.dbus_init() File "/usr/lib/python3/dist-packages/secretstorage/init__.py", line 80, in dbus_init raise SecretServiceNotAvailableException(str(ex)) from ex secretstorage.exceptions.SecretServiceNotAvailableException: [Errno 32] Broken pipe

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/bin/protonvpn-cli", line 11, in load_entry_point('protonvpn-cli==3.9.0', 'console_scripts', 'protonvpn-cli')() File "/usr/lib/python3/dist-packages/protonvpn_cli/main.py", line 21, in main ProtonVPNCLI() File "/usr/lib/python3/dist-packages/protonvpn_cli/cli.py", line 65, in init res = getattr(self, args.command)() File "/usr/lib/python3/dist-packages/protonvpn_cli/cli.py", line 71, in c return self.connect() File "/usr/lib/python3/dist-packages/protonvpn_cli/cli.py", line 133, in connect return self.cli_wrapper.connect(args) File "/usr/lib/python3/dist-packages/protonvpn_cli/cli_wrapper.py", line 146, in connect if not self.protonvpn.check_session_exists(): File "/usr/lib/python3/dist-packages/protonvpn_nm_lib/api.py", line 321, in check_session_exists return self._env.api_session.is_valid File "/usr/lib/python3/dist-packages/protonvpn_nm_lib/core/environment.py", line 54, in api_session self.__api_session = APISession() File "/usr/lib/python3/dist-packages/protonvpn_nm_lib/core/session/session.py", line 200, in init self.keyring_load_session() File "/usr/lib/python3/dist-packages/protonvpn_nm_lib/core/session/session.py", line 242, in keyring_load_session keyring_data_user = ExecutionEnvironment().keyring[ File "/usr/lib/python3/dist-packages/protonvpn_nm_lib/core/keyring/linuxkeyring.py", line 32, in getitem raise exceptions.KeyringError(e) protonvpn_nm_lib.exceptions.KeyringError: [Errno 32] Broken pipe

Could you explain to me what is going on, and how to configure proton so that it connects automatically after the wifi connection is stable?

I thank you in advance,

SR

calexandru2018 commented 2 years ago

@samhrvrdx you're not supposed to run as root.

samychkeit commented 2 years ago

Indeed, thank you for your reply.

For those who would like ProtonVPN to connect when Debian / Ubuntu starts, you simply have to configure Network manager by importing the configuration files of the desired servers, entering the connection identifiers, then in the advanced configuration (nm-connection-editor) by configuring each network connection so that it connects automatically at the same time as the favorite VPN server (General tab, automatically connect to VPN).

natanjunges commented 2 years ago

Check out my comment on https://github.com/ProtonVPN/linux-app/issues/4#issuecomment-953313052. It is a service in user space, which works just fine.