ProtonVPN / protonvpn-cli

Legacy protonvpn-cli: ProtonVPN Command-Line Tool for Linux and macOS. This has been superseded by https://github.com/ProtonVPN/protonvpn-cli-ng
Other
607 stars 98 forks source link

"There is a internet connection issue" #179

Open eknowlton opened 5 years ago

eknowlton commented 5 years ago

It's very cool that you provide a CLI tool for users to connect to ProtoVPN. I'm excited to be able to use it.

Although, I can't seem to get it to work.

I've installed using the documentation, and I initiated a configuration file with protonvpn-cli --init, but every time I try to use it, in this example protovpn-cli -m, I seem to get a problem such as follows.

2019-03-17-150417_952x368_scrot

I'm on running 5.0.0-arch1-1-ARCH. Any ideas on how to diagnose this?

eknowlton commented 5 years ago

I also receive "Error" while trying to use protovpn-cli --ip.

xilopaint commented 5 years ago

Please, provide logs with sudo PROTONVPN_CLI_LOG=true pvpn -f.

eknowlton commented 5 years ago
$ sudo protonvpn-cli --status                                                                                                             
[OpenVPN Status]: Not Running
[ProtonVPN Status]: Not Running
[Internet Status]: Offline
$ sudo PROTONVPN_CLI_LOG=true pvpn -f                                                                                               
[!] Error: There is an internet connection issue.
$ ping google.com                                                                                                               
PING google.com (74.125.21.138) 56(84) bytes of data.
64 bytes from yv-in-f138.1e100.net (74.125.21.138): icmp_seq=1 ttl=41 time=19.9 ms
64 bytes from yv-in-f138.1e100.net (74.125.21.138): icmp_seq=2 ttl=41 time=23.1 ms
64 bytes from yv-in-f138.1e100.net (74.125.21.138): icmp_seq=3 ttl=41 time=19.4 ms
^C
--- google.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 5ms
rtt min/avg/max/mdev = 19.365/20.764/23.054/1.640 ms
Tamaranch commented 5 years ago

Can you ping api.protonmail.ch? If not, don't you have a firewall somewhere on your connection that would be the cause?

eknowlton commented 5 years ago

I can ping api.protonmail.ch. There is no firewall.

2019-03-31-165120_1046x311_scrot

Tamaranch commented 5 years ago

Ok, so what about wget --header 'x-pm-appversion: Other' --header 'x-pm-apiversion: 3' --header 'Accept: application/vnd.protonmail.v1+json' -o /dev/null --timeout 6 --tries 1 -O - 'https://api.protonmail.ch/vpn/location'

eknowlton commented 5 years ago

I feel like I tried this before and received a different error, but now I get {"Code":1000,"IP":"#.#.#.#","Lat": ##,"Long":##,"Country":"US","ISP":"Spectrum"}

Tamaranch commented 5 years ago

Have you put the "#" for your IP, or is it the real output?

eknowlton commented 5 years ago

The IP and Long/Lat were correct, I just replaced them. Sorry about that.

Tamaranch commented 5 years ago

Ok, and pvpn -ip does not work at that time?

eknowlton commented 5 years ago

Yup, it returns my ip.

Tamaranch commented 5 years ago

Ok, so sudo pvpn --status should also work. Can you verify?

eknowlton commented 5 years ago

Ya, here you go...

$ sudo pvpn --status
[OpenVPN Status]: Not Running
[ProtonVPN Status]: Not Running
[Internet Status]: Offline
Tamaranch commented 5 years ago

The "Offline" Internet status is weird, because it is only based upon pvpn --ip. What about sudo pvpn -ip? Do you obtain the same output with or without sudo?

eknowlton commented 5 years ago

I think your on to something. When I run pvpn -ip I get my IP as expected. When I run sudo pvpn --ip I receive Error.

eknowlton commented 5 years ago

Although I can run sudo wget --header 'x-pm-appversion: Other' --header 'x-pm-apiversion: 3' --header 'Accept: application/vnd.protonmail.v1+json' -o /dev/null --timeout 6 --tries 1 -O - 'https://api.protonmail.ch/vpn/location' and get the expected response.

Tamaranch commented 5 years ago

Ok, so perhaps that the problem comes from the call of python in the code. What about sudo wget --header 'x-pm-appversion: Other' --header 'x-pm-apiversion: 3' --header 'Accept: application/vnd.protonmail.v1+json' -o /dev/null --timeout 6 --tries 1 -O - 'https://api.protonmail.ch/vpn/location' | sudo python -c 'import json; _ = open("/dev/stdin", "r").read(); print(json.loads(_)["IP"])'?

eknowlton commented 5 years ago

It apparently has something to do with the way I have python installed. I use asdf and have it installed that way, and it hasn't resulted in any problems...

When I run sudo python ..., I receive No such plugin: python

Tamaranch commented 5 years ago

Just to be sure, if you replace sudo python by python in the previous code, it gives you your IP, right?

eknowlton commented 5 years ago

Yes, it sure does.

eknowlton commented 5 years ago

Seems like you could get away without that, eh?

Tamaranch commented 5 years ago

Perhaps that @mazen160 should have a look at this, but he hasn't been there for a while now. I'm sorry, but I don't know how to solve your problem at that step. Perhaps someone else, @xilopaint ?

eknowlton commented 5 years ago

Either way I appreciate you working with me to get this working. Seems there could be a way couple ways to address this, but for now I'll just connect via openvpn for now.

Thanks again!

xilopaint commented 5 years ago

@eknowlton are you still interested in this issue?

goffinet commented 5 years ago

@eknowlton,

The script use wget binary without the --no-check-certificate option.

You can use force this option on your system :

echo "check_certificate = off" >> ~/.wgetrc
eknowlton commented 5 years ago

It seems that the problem has to do with the script using sudo to call python. Not to do with wget.

https://github.com/ProtonVPN/protonvpn-cli/issues/179#issuecomment-478388750

eknowlton commented 5 years ago

It would seem to me that this command doesn't need and it would pose a security risk to do so anyways.

eknowlton commented 5 years ago

It does, yes.

On Fri, May 24, 2019, 3:22 PM Arthur Pinheiro notifications@github.com wrote:

It seems that the problem has to do with the script using sudo to call python. Not to do with wget.

So does the CLI work properly if you suppress sudo?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ProtonVPN/protonvpn-cli/issues/179?email_source=notifications&email_token=AAEFAF7L5RS4T2VBX5O4VODPXA55TA5CNFSM4G7CKBCKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODWGLPZQ#issuecomment-495761382, or mute the thread https://github.com/notifications/unsubscribe-auth/AAEFAF2CIIVYGOCSBL4WV2TPXA55TANCNFSM4G7CKBCA .