nordvpn icon indicating copy to clipboard operation
nordvpn copied to clipboard

Timeout when running best

Open recke96 opened this issue 6 years ago • 4 comments

I have a timeout when running the best-command. I have added the verbose output.

> sudo nordvpn -v best -r eu -n 10
+ shift
+ '[' 5 -ne 0 ']'
+ case "$1" in
+ command=best
+ shift
+ break
+ '[' -z best ']'
++ id -u
+ '[' 0 -ne 0 ']'
++ find /etc/openvpn/client -type f -name '*.nordvpn.com.*.ovpn'
++ wc -l
+ declare -r -i files_present=9955
+ declare -r -i up_to_date=1
+ '[' 9955 -eq 0 ']'
+ '[' best '!=' status ']'
+ '[' 1 -eq 0 ']'
+ case $command in
+ case "$1" in
++ ensure_infos -r
++ declare -i force_update=0
++ case "$1" in
++ declare -r servers_filename=/tmp/nordvpn_servers.json
++ '[' 0 -eq 1 ']'
++ '[' '!' -f /tmp/nordvpn_servers.json ']'
+++ find /tmp/nordvpn_servers.json -mmin +15
++ '[' '!' -z '' ']'
++ echo /tmp/nordvpn_servers.json
++ return
+ servers_filename=/tmp/nordvpn_servers.json
+ test 0 -eq 0
+ run_servers /tmp/nordvpn_servers.json --ranking -r eu -n 10
+ which python3
+ timeout -v --signal=SIGINT 1m python3 /etc/openvpn/client/nordvpn/servers.py /tmp/nordvpn_servers.json --ranking -r eu -n 10
timeout: sending signal INT to command ‘python3’
Traceback (most recent call last):
  File "/etc/openvpn/client/nordvpn/servers.py", line 186, in <module>
    print(get_best(servers, args))
  File "/etc/openvpn/client/nordvpn/servers.py", line 105, in get_best
    pings = pingservers(servers.name.tolist(), count=args.pingcount)
  File "/etc/openvpn/client/nordvpn/servers.py", line 78, in pingservers
    callsig + addresses, check=False, universal_newlines=True, stderr=PIPE)
  File "/usr/lib/python3.7/subprocess.py", line 455, in run
    stdout, stderr = process.communicate(input, timeout=timeout)
  File "/usr/lib/python3.7/subprocess.py", line 910, in communicate
    stderr = self.stderr.read()
KeyboardInterrupt

Is this a network-timeout (I have a connection) or another error? My system runs on Linux 4.18.12-arch1-1-ARCH x86_64

recke96 avatar Oct 08 '18 09:10 recke96

Hi!

My guess is that you probably ran it with a vpn connection already established. Can you make sure no vpn connection is active when you run the best command? It this is the case, we'll have to protect the call.

Alternatively, do you know that the start command now uses nordvpn.com to find a recommended server? It is not yet able to select it by country but that might be a good alternative.

nstinus avatar Oct 13 '18 14:10 nstinus

No I didn't run it with active VPN, but I just started using it by manually selecting a server. Connecting to a selected server works fine.

recke96 avatar Oct 14 '18 16:10 recke96

Can confirm this. Happens when connected and disconnected from any vpns.

sudo nordvpn -v best -r na
+ shift
+ '[' 3 -ne 0 ']'
+ case "$1" in
+ command=best
+ shift
+ break
+ '[' -z best ']'
++ id -u
+ '[' 0 -ne 0 ']'
++ find /etc/openvpn/client -type f -name '*.nordvpn.com.*.ovpn'
++ wc -l
+ declare -r -i files_present=9875
+ declare -r -i up_to_date=1
+ '[' 9875 -eq 0 ']'
+ '[' best '!=' status ']'
+ '[' 1 -eq 0 ']'
+ case $command in
+ case "$1" in
++ ensure_infos -r
++ declare -i force_update=0
++ case "$1" in
++ declare -r servers_filename=/tmp/nordvpn_servers.json
++ '[' 0 -eq 1 ']'
++ '[' '!' -f /tmp/nordvpn_servers.json ']'
+++ find /tmp/nordvpn_servers.json -mmin +15
++ '[' '!' -z '' ']'
++ echo /tmp/nordvpn_servers.json
++ return
+ servers_filename=/tmp/nordvpn_servers.json
+ test 0 -eq 0
+ run_servers /tmp/nordvpn_servers.json --ranking -r na
+ which python3
+ timeout -v --signal=SIGINT 1m python3 /etc/openvpn/client/nordvpn/servers.py /tmp/nordvpn_servers.json --ranking -r na
timeout: sending signal INT to command ‘python3’
Traceback (most recent call last):
  File "/etc/openvpn/client/nordvpn/servers.py", line 186, in <module>
    print(get_best(servers, args))
  File "/etc/openvpn/client/nordvpn/servers.py", line 105, in get_best
    pings = pingservers(servers.name.tolist(), count=args.pingcount)
  File "/etc/openvpn/client/nordvpn/servers.py", line 78, in pingservers
    callsig + addresses, check=False, universal_newlines=True, stderr=PIPE)
  File "/usr/lib/python3.7/subprocess.py", line 468, in run
    stdout, stderr = process.communicate(input, timeout=timeout)
  File "/usr/lib/python3.7/subprocess.py", line 923, in communicate
    stderr = self.stderr.read()
KeyboardInterrupt

My system is Linux 4.18.16-arch1-1-ARCH x86_64.

goofolph avatar Oct 31 '18 18:10 goofolph

Can confirm, also still present.

This commit is the problem: https://github.com/nstinus/nordvpn/commit/daf5ff0b62fe919b2c7b4daf5cc5598e1adb0b7f

Quick workaround for everyone with this problem is to change line 54 into:

python3 /etc/openvpn/client/nordvpn/servers.py $@

But I'll leave up @nstinus the proper solution.

pbabbicola avatar Jan 20 '19 18:01 pbabbicola