Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
kohane27 opened this issue Mar 13, 2024 · 16 comments
Open

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

kohane27 opened this issue Mar 13, 2024 · 16 comments

Comments

@kohane27
Copy link

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.

@autogris
Copy link

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!

@kohane27
Copy link
Author

@autogris What does protonvpn --version show?

@autogris
Copy link

ProtonVPN-CLI v2.2.12

@autogris
Copy link

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

@calexandru2018
Copy link
Collaborator

calexandru2018 commented Mar 13, 2024

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/

@HackedArtichoke
Copy link

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.

@fung
Copy link

fung commented Mar 13, 2024

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

@calexandru2018
Copy link
Collaborator

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.

@HackedArtichoke
Copy link

HackedArtichoke commented Mar 13, 2024 via email

@autogris
Copy link

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.

@kohane27
Copy link
Author

kohane27 commented Mar 14, 2024

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!

@stelgenhof
Copy link

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).

@walterl
Copy link

walterl commented Mar 17, 2024

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.

@traktuner
Copy link

@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

@kylekatarnls
Copy link
Contributor

kylekatarnls commented Mar 18, 2024

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)

@4censord
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants