Rafficer / linux-cli-community

Linux command-line client for ProtonVPN. Written in Python.

Home Page:https://protonvpn.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] There was an error connecting to the ProtonVPN API.

kohane27 opened this issue · comments

Description

Running sudo protonvpn connect gives the following error:

[!] There was an error connecting to the ProtonVPN API.
[!] Please make sure your connection is working properly!
[!] HTTP Error Code: 422

Confirmed I'm not the only one: protonvpn_cli_api_not_working.

Solution

I resolved it with the latest linux-cli-community version.

I followed Manual Installation from source.

Note: pipx upgrade protonvpn-cli doesn't work.

Make sure you're on the latest version:

➜ protonvpn --version

ProtonVPN now offers an official Linux app which includes a graphical user interface.
Visit https://protonvpn.com/support/official-linux-client to upgrade.
ProtonVPN-CLI v2.2.12

After installing, I ran sudo protonvpn init and then sudo protonvpn c works again.

Thank you.

I've experienced the same problem today but the above solution didn't solve. I get the following error:

Writing configuration to disk...
[!] There was an error connecting to the ProtonVPN API.
[!] Please make sure your connection is working properly!

@autogris What does protonvpn --version show?

ProtonVPN-CLI v2.2.12

Ah, it seems some problem with network manager. After rebooting I've got protonvpn init to finish its writing process! Sorry!

Hey all 👋

The community CLI is no longer supported, since we've introduced new features and are continuing to add new features in the new Linux native client that aren't compatible with the community CLI. In addition to this, the community CLI hasn't been actively maintained in the past few years (as you can see by the commits).

If you're on a supported distro, please consider trying the latest version of our native Linux client: https://protonvpn.com/support/linux-vpn-setup/

Otherwise, you could also consider a manual configuration: https://protonvpn.com/support/wireguard-manual-linux/

Seems like it works.... Noticed that protonvpn status returned.....

# protonvpn s Traceback (most recent call last): File "/usr/local/bin/protonvpn", line 33, in <module> sys.exit(load_entry_point('protonvpn-cli', 'console_scripts', 'protonvpn')()) File "/app/linux-cli-community/protonvpn_cli/cli.py", line 72, in main cli() File "/app/linux-cli-community/protonvpn_cli/cli.py", line 144, in cli connection.status() File "/app/linux-cli-community/protonvpn_cli/connection.py", line 444, in status + "Features: {0}\n".format(all_features[feature]) KeyError: 12

@calexandru2018 Looks like you had a hand in the merging of the project. Great work, this update saved me.

commented

It works now after installed cli from source. Thanks @calexandru2018 this update saved me too.

Just a friendly heads-up: it's probably best not to rely too heavily on the latest version. We're planning to fully end the support in the near future (for reasons explained above). So, while things might still be working for some days, it's perhaps best to see if the native client or manual configuration are viable alternative for your situation.

It would be very important for proton to develop an official application that doesn't rely on systemd as the only possible choice. Many of us will be cut off when linux-cli no longer works.

I've switched to using WireGuard with ProtonVPN. The following is what I did.

  1. Follow the official guide How to download WireGuard configuration files.

  2. Install WireGuard:

sudo pacman -S wireguard-tools
  1. Create a new WireGuard configuration file:
sudo vim /etc/wireguard/wg0.conf
  1. Paste the downloaded ProtonVPN WireGuard configuration file content
[Interface]
PrivateKey = ****
Address = 10.2.0.2/32
DNS = 10.2.0.1

[Peer]
PublicKey = ****
AllowedIPs = 104.18.6.192/32, 104.18.7.192/32
Endpoint = ***.***

Note: modify the line AllowedIPs for the traffic to be routed through WireGuard. 104.18.6.192/32 and 104.18.7.192/32 are api.openai.com.

  1. Start the WireGuard interface:
sudo wg-quick up wg0

Verified the traffic is routed through WireGuard:

➜ ip route get 104.18.6.192
104.18.6.192 dev wg0 src 10.2.0.2 uid 1000
    cache

10.2.0.2 is the proof that the traffic is routed through ProtonVPN (ref).

Bonus: Use systemd to automatically start the WireGuard interface on system boot:

sudo systemctl enable wg-quick@wg0.service

Cheers!

I had the same issue, and after reading the comments, switched to WireGuard. Did pretty much the same as @kohane27 explained. Works great!

(Running Arch Linux as well).

To support @HackedArtichoke's position: once this CLI stops working, one of my 2 major use cases for ProtonVPN will be broken, and I will be forced to look at alternative VPN providers.

I can understand the business decision to try and focus development on the most common use cases, but it unfortunately means losing more technical customers like myself, who require more flexibility. It also tends to be customers like us that go to make recommendations about VPN providers to others, both personally and professionally.

@calexandru2018 Can the official protonvpn-cli be used as a direct "drop-in" replacement or do the connect commands like
protonvpn connect --cc <contrycode> etc change?
Thank you

commented

As a note, there are very valid reasons to sunset the support. Among other things, this non-official CLI does not support 2FA and makes unauthenticated call, most of our technical customers are also generally sensible to those matters, also because it's not owned by Proton, there is no warranty on it.

If you are unable to use the official client, the alternative is to download Wireguard config files as @kohane27 explained #365 (comment)

Just to add my own voice: I this also impacts me, and will not be renewing my subscription as well.
With this, it was incredibly simple to add shortcuts for different countries/configurations to my de, by just having it call a script. With the new app not supporting any cli functionality at all, it gets almost impossible to script around it.
And importing dozens of WireGuard profiles is also not ideal.

RE: 2fa:
I'd be fine with no 2fa on my vpn provider.