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

The name org.freedesktop.NetworkManager was not provided by any .service files #24

Closed rEnr3n closed 3 years ago

rEnr3n commented 3 years ago

I don't use NetworkManager. I use systemd-networkd instead.

$ protonvpn-cli --version

ProtonVPN CLI v3.7.1 (protonvpn-nm-lib v3.3.1; proton-client v0.5.1)
$ protonvpn-cli login <USERNAME>
Enter your ProtonVPN password: 

org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.NetworkManager was not provided by any .service files

protonvpn-cli.log

2021-07-05 16:30:01,176 — cli.py — INFO — __init__:17 — 
-------------------------------------------------

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

-------------------------------------------------
2021-07-05 16:30:01,176 — cli.py — INFO — __init__:29 — ProtonVPN CLI v3.7.1 (protonvpn-nm-lib v3.3.1; proton-client v0.5.1)
2021-07-05 16:30:01,178 — cli.py — INFO — __init__:62 — CLI command: Namespace(command='login', version=False, help=False, get_logs=False)
2021-07-05 16:30:08,813 — cli_wrapper.py — INFO — login:68 — Credentials provided, attempting to login
2021-07-05 16:30:08,818 — cli_wrapper.py — ERROR — login:73 — org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.NetworkManager was not provided by any .service files
Traceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/dbus/bus.py", line 177, in activate_name_owner
    return self.get_name_owner(bus_name)
  File "/usr/lib/python3.9/site-packages/dbus/bus.py", line 361, in get_name_owner
    return self.call_blocking(BUS_DAEMON_NAME, BUS_DAEMON_PATH,
  File "/usr/lib/python3.9/site-packages/dbus/connection.py", line 652, in call_blocking
    reply_message = self.send_message_with_reply_and_block(
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NameHasNoOwner: Could not get owner of name 'org.freedesktop.NetworkManager': no such name

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/protonvpn_cli/cli_wrapper.py", line 71, in login
    self.protonvpn.login(username, password)
  File "/usr/lib/python3.9/site-packages/protonvpn_nm_lib/api.py", line 29, in login
    self._utils.ensure_connectivity()
  File "/usr/lib/python3.9/site-packages/protonvpn_nm_lib/core/utilities.py", line 16, in ensure_connectivity
    utils.ensure_internet_connection_is_available()
  File "/usr/lib/python3.9/site-packages/protonvpn_nm_lib/core/utilities.py", line 22, in ensure_internet_connection_is_available
    if ExecutionEnvironment().killswitch != KillswitchStatusEnum.DISABLED:
  File "/usr/lib/python3.9/site-packages/protonvpn_nm_lib/core/environment.py", line 65, in killswitch
    self.__killswitch = KillSwitch()
  File "/usr/lib/python3.9/site-packages/protonvpn_nm_lib/core/killswitch/killswitch.py", line 61, in __init__
    self.get_status_connectivity_check()
  File "/usr/lib/python3.9/site-packages/protonvpn_nm_lib/core/killswitch/killswitch.py", line 597, in get_status_connectivity_check
    nm_props = self.nm_wrapper.get_network_manager_properties()
  File "/usr/lib/python3.9/site-packages/protonvpn_nm_lib/core/dbus/dbus_network_manager_wrapper.py", line 461, in get_network_manager_properties
    self.get_network_manager_proxy_object()
  File "/usr/lib/python3.9/site-packages/protonvpn_nm_lib/core/dbus/dbus_network_manager_wrapper.py", line 510, in get_network_manager_proxy_object
    return self.__get_proxy_object(SystemBusNMObjectPathEnum.NETWORK_MANAGER.value)
  File "/usr/lib/python3.9/site-packages/protonvpn_nm_lib/core/dbus/dbus_network_manager_wrapper.py", line 534, in __get_proxy_object
    return self.__dbus_wrapper.get_proxy_object(
  File "/usr/lib/python3.9/site-packages/protonvpn_nm_lib/core/dbus/dbus_wrapper.py", line 59, in get_proxy_object
    return self.bus.get_object(
  File "/usr/lib/python3.9/site-packages/dbus/bus.py", line 241, in get_object
    return self.ProxyObjectClass(self, bus_name, object_path,
  File "/usr/lib/python3.9/site-packages/dbus/proxies.py", line 250, in __init__
    self._named_service = conn.activate_name_owner(bus_name)
  File "/usr/lib/python3.9/site-packages/dbus/bus.py", line 182, in activate_name_owner
    self.start_service_by_name(bus_name)
  File "/usr/lib/python3.9/site-packages/dbus/bus.py", line 277, in start_service_by_name
    return (True, self.call_blocking(BUS_DAEMON_NAME, BUS_DAEMON_PATH,
  File "/usr/lib/python3.9/site-packages/dbus/connection.py", line 652, in call_blocking
    reply_message = self.send_message_with_reply_and_block(
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.NetworkManager was not provided by any .service files
mrlinuxfish commented 3 years ago

I have the same issue. I've tried using the openvpn username / password as well and that also doesn't work. On the gui app I get "Unknown error occured. If the issue persists, please contact support."

It appears to be because this version of protonvpn-cli requires network manager for some reason. I would very much like to use the newer one, if it is indeed better, but only if I don't need to use network manager

calexandru2018 commented 3 years ago

@rEnr3n and @mrlinuxfish network manager is a hard depedency, without you won't be able to use our official clients. As an alternative you could try the following:

rEnr3n commented 3 years ago

network manager is a hard depedency

Will this change in the future? IIRC, I had an issue with NetworkManager before, so I can't use it.

calexandru2018 commented 3 years ago

Given current situation no, as the idea is to have the VPN to be well integrated with the distro. But as with all things, things might change.