protonvpn RuntimeError: Couldn't find acceptable executables for {'xdg-open'}

1k views Asked by At

In short, whenever I try to run from the command line protonvpn-cli or protonvpn-gui, I get similar errors: RuntimeError: Couldn't find acceptable executables for {'xdg-open'}.
A couple of minor differences:
1) For protonvpn-cli I get the error right after executing; for protonvpn-gui the interface launches OK, and I get the error when trying to Quick connect.
2) For protonvpn-gui I am asked for my password because of an apparent sudo call.

How can I solve this?

I am posting below:

  1. The complete errors obtained.
  2. Info on my OS, etc.
  3. Some debugging I made in python.

Complete errors

For protonvpn-cli:

$ /usr/bin/protonvpn-cli
Traceback (most recent call last):
  File "/usr/bin/protonvpn-cli", line 11, in <module>
    load_entry_point('protonvpn-cli==3.11.1', 'console_scripts', 'protonvpn-cli')()
  File "/usr/lib/python3/dist-packages/protonvpn_cli/main.py", line 20, in main
    from .cli import ProtonVPNCLI
  File "/usr/lib/python3/dist-packages/protonvpn_cli/cli.py", line 8, in <module>
    from .cli_wrapper import CLIWrapper
  File "/usr/lib/python3/dist-packages/protonvpn_cli/cli_wrapper.py", line 9, in <module>
    from protonvpn_nm_lib.api import protonvpn
  File "/usr/lib/python3/dist-packages/protonvpn_nm_lib/api.py", line 6, in <module>
    from .core.report import BugReport
  File "/usr/lib/python3/dist-packages/protonvpn_nm_lib/core/report/__init__.py", line 1, in <module>
    from .bug import BugReport
  File "/usr/lib/python3/dist-packages/protonvpn_nm_lib/core/report/bug.py", line 7, in <module>
    from ..subprocess_wrapper import subprocess
  File "/usr/lib/python3/dist-packages/protonvpn_nm_lib/core/subprocess_wrapper.py", line 123, in <module>
    subprocess = SubprocessWrapper() # noqa
  File "/usr/lib/python3/dist-packages/protonvpn_nm_lib/core/subprocess_wrapper.py", line 34, in __init__
    self.__ensure_executables_exist()
  File "/usr/lib/python3/dist-packages/protonvpn_nm_lib/core/subprocess_wrapper.py", line 81, in __ensure_executables_exist
    raise RuntimeError(
RuntimeError: Couldn't find acceptable executables for {'xdg-open'}

For protonvpn-gui:

$ /home/user1/anaconda3/bin/protonvpn-gui
[sudo] password for user1:

(protonvpn-gui:7452): Gtk-WARNING **: 05:24:59.860: Failed to set text 'traceback (most recent call last):
  file "/usr/bin/protonvpn", line 11, in <module>
    load_entry_point('protonvpn-gui==1.7.0', 'console_scripts', 'protonvpn')()
  file "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 490, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  file "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2854, in load_entry_point
    return ep.load()
  file "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2445, in load
    return self.resolve()
  file "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2451, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  file "/usr/lib/python3/dist-packages/protonvpn_gui/main.py", line 16, in <module>
    from protonvpn_nm_lib.api import protonvpn
  file "/usr/lib/python3/dist-packages/protonvpn_nm_lib/api.py", line 6, in <module>
    from .core.report import bugreport
  file "/usr/lib/python3/dist-packages/protonvpn_nm_lib/core/report/__init__.py", line 1, in <module>
    from .bug import bugreport
  file "/usr/lib/python3/dist-packages/protonvpn_nm_lib/core/report/bug.py", line 7, in <module>
    from ..subprocess_wrapper import subprocess
  file "/usr/lib/python3/dist-packages/protonvpn_nm_lib/core/subprocess_wrapper.py", line 123, in <module>
    subprocess = subprocesswrapper() # noqa
  file "/usr/lib/python3/dist-packages/protonvpn_nm_lib/core/subprocess_wrapper.py", line 34, in __init__
    self.__ensure_executables_exist()
  file "/usr/lib/python3/dist-packages/protonvpn_nm_lib/core/subprocess_wrapper.py", line 81, in __ensure_executables_exist
    raise runtimeerror(
runtimeerror: couldn't find acceptable executables for {'xdg-open'}
' from markup due to error parsing markup: Error on line 27 char 10: Element "markup" was closed, but the currently open element is "module"

Info on OS, etc.

I am using Bodhi Linux, an Ubuntu derivative which, in my experience, for most purposes (but not all) works the same as Ubuntu. So much so that

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.4 LTS
Release:        20.04
Codename:       focal

I have installed protonvpn while in a (base) virtualenv from anaconda3. I didn't do it on purpose, but it was just the default behaviour as per .bashrc. One of the consequences is that, since protonvpn is (at least partly) a set of python scripts, some of them (but not all) were installed to anaconda3 dirs.

$ type protonvpn
protonvpn is /home/user1/anaconda3/bin/protonvpn
$ type protonvpn-gui
protonvpn-gui is /home/user1/anaconda3/bin/protonvpn-gui
$ type protonvpn-cli
protonvpn-cli is /usr/bin/protonvpn-cli

I guess this mixup is part of the problem

$ ll /home/user1/anaconda3/bin/python3
/home/user1/anaconda3/bin/python3 -> python3.9
$ ll /home/user1/anaconda3/bin/python3.9
/home/user1/anaconda3/bin/python3.9
$ ll /usr/bin/python3.8
/usr/bin/python3.8

Debugging in python

I launched spyder with sudo /home/user1/anaconda3/bin/spyder and from there I opened and debugged /home/user1/anaconda3/bin/protonvpn-gui. Setting a breakpoint right before the error in subprocess_wrapper.py:81, I found it requires 4 binaries (as listed in the set _acceptable_binaries): nmcli, xdg-open, clear, systemctl. The dict _path_to_binaries shows that it found only 3 of them: { clear: /usr/bin/clear, nmcli: /usr/bin/nmcli, systemctl: /usr/bin/systemctl }. It is strange that /usr/bin/xdg-open, in the same dir, was not found. Unless there is a problem with versions.

1

There are 1 answers

2
doraemon1 On

I'm not sure why that occurs but just edit the python file for now.

/usr/lib/python3/dist-packages/protonvpn_nm_lib/core/subprocess_wrapper.py

 76         # Were we unable to find executables? This is bad
 77         if len(self._path_to_binaries) != len(self._acceptable_binaries):
 78             missing_executables = self._acceptable_binaries.difference(
 79                 self._path_to_binaries.keys()
 80             )
 81             """raise RuntimeError(
 82                 "Couldn't find acceptable "
 83                 "executables for {}".format(missing_executables)
 84             )"""
 85             pass

I commented raise RuntimeError part and added pass