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

Timeout when running best #38

Open
recke96 opened this issue Oct 8, 2018 · 4 comments
Open

Timeout when running best #38

recke96 opened this issue Oct 8, 2018 · 4 comments

Comments

@recke96
Copy link

recke96 commented Oct 8, 2018

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

@nstinus
Copy link
Owner

nstinus commented Oct 13, 2018

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.

@recke96
Copy link
Author

recke96 commented Oct 14, 2018

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.

@goofolph
Copy link

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.

@pbabbicola
Copy link

pbabbicola commented Jan 20, 2019

Can confirm, also still present.

This commit is the problem: daf5ff0

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.

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

4 participants