jotyGill / openpyn-nordvpn

Easily connect to and switch between, OpenVPN servers hosted by NordVPN on Linux (+patch leakes)
GNU General Public License v3.0
628 stars 114 forks source link

Ping always failing in alpine #208

Closed Omegagoth closed 5 years ago

Omegagoth commented 5 years ago

On an alpine based system (run inside a docker), after having installed all the dependency the ping test is always failing.

According to NordVPN, Least Busy 5 Servers in NL With 'Load' Less Than 70 Which Support OPENVPN-UDP , p2p = True Are: [['nl57', 4], ['nl67', 4], ['nl74', 4], ['nl107', 4], ['nl115', 4]]

2018-10-13 04:17:06 [WARNING] Your 'ping' command doesn't support '-i' or '-n', falling back to wait of 1 second between pings, pings will be slow
2018-10-13 04:17:08 [WARNING] Ping Failed to: nl57, excluding it from the list
2018-10-13 04:17:10 [WARNING] Ping Failed to: nl67, excluding it from the list
2018-10-13 04:17:12 [WARNING] Ping Failed to: nl74, excluding it from the list
2018-10-13 04:17:15 [WARNING] Ping Failed to: nl107, excluding it from the list
2018-10-13 04:17:17 [WARNING] Ping Failed to: nl115, excluding it from the list
Top 0 Servers with Best Ping Are: []

According to NordVPN, Least Busy 5 Servers in NL With 'Load' Less Than 70 Which Support OPENVPN-UDP , p2p = True Are: [['nl57', 4], ['nl67', 4], ['nl74', 4], ['nl107', 4], ['nl115', 4]]

2018-10-13 04:17:17 [WARNING] Your 'ping' command doesn't support '-i' or '-n', falling back to wait of 1 second between pings, pings will be slow
2018-10-13 04:17:19 [WARNING] Ping Failed to: nl57, excluding it from the list
2018-10-13 04:17:21 [WARNING] Ping Failed to: nl67, excluding it from the list
^C2018-10-13 04:17:22 [INFO] KeyboardInterrupt; Shutting down

After investigation this due to the ping output being:

bash-4.4# ping nl74.nordvpn.com
PING nl74.nordvpn.com (89.38.96.189): 56 data bytes
64 bytes from 89.38.96.189: seq=0 ttl=50 time=20.606 ms
64 bytes from 89.38.96.189: seq=1 ttl=50 time=20.650 ms
64 bytes from 89.38.96.189: seq=2 ttl=50 time=20.588 ms
64 bytes from 89.38.96.189: seq=3 ttl=50 time=20.628 ms
^C
--- nl74.nordvpn.com ping statistics ---
4 packets transmitted, 4 packets received, 0% packet loss
round-trip min/avg/max = 20.588/20.618/20.650 ms

Therefore it never contains "min/avg/max/" which is the regex searched. Plus after this error corrected we encounter an outofbound error a little bit further in the code as we try to access the mdev (item[1][3]) which is not present here. I have proposed an pull request to resolve that see #209 .