chadsr / NordVPN-NetworkManager

A CLI tool for automating the importing, securing and usage of NordVPN (and in the future, more) OpenVPN servers through NetworkManager.
https://pypi.org/project/nordnm/
GNU General Public License v3.0
123 stars 28 forks source link

VPN config file not found #113

Closed ape364 closed 5 years ago

ape364 commented 5 years ago

I'm trying to sync servers:

 ~  sudo nordnm sync -uka fi normal udp
[ERROR] [nordnm.utils]: Could not check PyPi for latest version.
     _   _               _ _   _ ___  ___
    | \ | |             | | \ | ||  \/  |
    |  \| | ___  _ __ __| |  \| || .  . |
    | . ` |/ _ \| '__/ _` | . ` || |\/| |
    | |\  | (_) | | | (_| | |\  || |  | |
    \_| \_/\___/|_|  \__,_\_| \_/\_|  |_/   v0.6.0

[INFO] [nordnm.nordnm]: Downloading latest NordVPN OpenVPN configuration files to '/home/ape364/.nordnm/configs/'.
[INFO] [nordnm.nordnm]: Configuration files already up-to-date.
[INFO] [nordnm.nordnm]: Checking for new connections to import...
[INFO] [nordnm.networkmanager]: Network kill-switch disabled.
[WARNING] [nordnm.nordnm]: Kill-switch disabled for accurate benchmarking. Your connection is not secure until these are re-enabled.
[INFO] [nordnm.nordnm]: Benchmarking 4690 servers...
[INFO] 4690/4690 benchmarks finished.
[INFO] [nordnm.nordnm]: Benchmarked 4494 servers successfully (95.82%). Took 24.28 seconds.
[INFO] [nordnm.nordnm]: Removing all active connections...
[INFO] [nordnm.nordnm]: Adding new connections...
[ERROR] [nordnm.networkmanager]: VPN config file not found! (/etc/NetworkManager/system-connections/uk762 [normal|p2p] [udp])
[ERROR] [nordnm.networkmanager]: VPN config file not found! (/etc/NetworkManager/system-connections/si3 [normal|p2p] [udp])
[ERROR] [nordnm.networkmanager]: VPN config file not found! (/etc/NetworkManager/system-connections/sk14 [normal|p2p] [udp])
...
[ERROR] [nordnm.networkmanager]: VPN config file not found! (/etc/NetworkManager/system-connections/gr7 [normal|p2p] [udp])
[ERROR] [nordnm.networkmanager]: VPN config file not found! (/etc/NetworkManager/system-connections/cl5 [normal] [udp])
[ERROR] [nordnm.networkmanager]: VPN config file not found! (/etc/NetworkManager/system-connections/cy4 [normal] [udp])
[INFO] [nordnm.nordnm]: No new connections added.
[INFO] [nordnm.networkmanager]: Network kill-switch enabled.
[ERROR] [nordnm.nordnm]: Auto-connect not activated: No active server found matching [fi, normal, udp].

Package versions:

 !  ~  sudo nordnm --v
0.6.0
 !  ~  NetworkManager -V
1.14.3dev+15+g3fc592219-1
 ~  uname -a
Linux MiBook 4.18.16-arch1-1-ARCH #1 SMP PREEMPT Sat Oct 20 22:06:45 UTC 2018 x86_64 GNU/Linux
 ~  python -V
Python 3.7.1

Connections:

[root@MiBook system-connections]# cd /etc/NetworkManager/system-connections/
[root@MiBook system-connections]# ls -la | grep udp
-rw------- 1 root root  602 Oct 23 23:59 ar3 [normal] [udp].nmconnection
-rw------- 1 root root  602 Oct 23 23:57 ar6 [normal] [udp].nmconnection
-rw------- 1 root root  603 Oct 23 23:57 br7 [normal] [udp].nmconnection
-rw------- 1 root root  605 Oct 23 23:57 cl3 [normal] [udp].nmconnection
-rw------- 1 root root  605 Oct 23 23:59 cl5 [normal] [udp].nmconnection
-rw------- 1 root root  605 Oct 23 23:57 cr6 [normal] [udp].nmconnection
-rw------- 1 root root  605 Oct 23 23:59 cr7 [normal] [udp].nmconnection
-rw------- 1 root root  605 Oct 23 23:57 cy3 [normal] [udp].nmconnection
-rw------- 1 root root  605 Oct 23 23:59 cy4 [normal] [udp].nmconnection
-rw------- 1 root root  619 Oct 24 00:22 fi14 [normal|p2p] [udp].nmconnection
-rw------- 1 root root  603 Oct 23 23:57 ge1 [normal] [udp].nmconnection
-rw------- 1 root root  604 Oct 23 23:59 ge4 [normal] [udp].nmconnection
-rw------- 1 root root  601 Oct 23 23:57 id6 [normal] [udp].nmconnection
-rw------- 1 root root  585 Oct 23 23:59 id7 [normal] [udp].nmconnection
-rw------- 1 root root  605 Oct 23 23:57 il7 [normal] [udp].nmconnection
-rw------- 1 root root  606 Oct 23 23:57 mx10 [normal] [udp].nmconnection
-rw------- 1 root root  607 Oct 23 23:59 mx11 [normal] [udp].nmconnection
-rw------- 1 root root  604 Oct 23 23:57 my5 [normal] [udp].nmconnection
-rw------- 1 root root  604 Oct 23 23:59 my7 [normal] [udp].nmconnection
-rw------- 1 root root  620 Oct 23 23:59 nz17 [normal|p2p] [udp].nmconnection
-rw------- 1 root root  620 Oct 23 23:57 nz22 [normal|p2p] [udp].nmconnection
Drose221193 commented 5 years ago

Having the same issue on Manjaro

[INFO] [nordnm.nordnm]: Downloading latest NordVPN OpenVPN configuration files to '/home/steve/.nordnm/configs/'. [INFO] [nordnm.nordnm]: Checking for new connections to import... [INFO] [nordnm.nordnm]: Benchmarking 4763 servers... [INFO] 4763/4763 benchmarks finished. [INFO] [nordnm.nordnm]: Benchmarked 4644 servers successfully (97.50%). Took 29.44 seconds. [INFO] [nordnm.nordnm]: Removing all active connections... [INFO] [nordnm.nordnm]: Adding new connections... [ERROR] [nordnm.networkmanager]: VPN config file not found! (/etc/NetworkManager/system-connections/us1237 [p2p|normal] [udp]) [ERROR] [nordnm.networkmanager]: VPN config file not found! (/etc/NetworkManager/system-connections/us1237 [p2p|normal] [tcp]) [ERROR] [nordnm.networkmanager]: VPN config file not found! (/etc/NetworkManager/system-connections/ca-us6 [double] [tcp]) [ERROR] [nordnm.networkmanager]: VPN config file not found! (/etc/NetworkManager/system-connections/us-ca5 [double] [tcp]) [ERROR] [nordnm.networkmanager]: VPN config file not found! (/etc/NetworkManager/system-connections/de219

sudo nordnm --v 0.6.0

NetworkManager -V 1.14.3dev+19+g2e5d0f304-1

uname -a Linux steve-Manjaro 4.19.0-1-MANJARO #1 SMP PREEMPT Mon Oct 22 18:40:59 UTC 2018 x86_64 GNU/Linux

python -V Python 3.7.1

chadsr commented 5 years ago

Huh, interesting.

It seems NetworkManager has added ".nmconnection" extensions to the system connections. Why the NetworkManager devs felt the need to change that, I do not know.

Anyway, looks like I will have to implement a fix to handle both cases with and without extensions. I will do my best to release a fix for this today, since it completely breaks nordnm.

Thanks for the catch, since i'm still on 1.14.1dev+13+g0d3234478-1 where this isn't an issue.

chadsr commented 5 years ago

I have released a hotfix for this in v0.6.1. Let me know if that clears everything up, or you experience other issues related to this.

Thanks!

ape364 commented 5 years ago

@Chadsr thanks! works perfect now:

 ~  sudo nordnm sync -uka fi normal udp
[ERROR] [nordnm.utils]: Could not check PyPi for latest version.
     _   _               _ _   _ ___  ___
    | \ | |             | | \ | ||  \/  |
    |  \| | ___  _ __ __| |  \| || .  . |
    | . ` |/ _ \| '__/ _` | . ` || |\/| |
    | |\  | (_) | | | (_| | |\  || |  | |
    \_| \_/\___/|_|  \__,_\_| \_/\_|  |_/   v0.6.1

[INFO] [nordnm.nordnm]: Downloading latest NordVPN OpenVPN configuration files to '/home/ape364/.nordnm/configs/'.
[INFO] [nordnm.nordnm]: Configuration files already up-to-date.
[INFO] [nordnm.nordnm]: Checking for new connections to import...
[INFO] [nordnm.networkmanager]: Network kill-switch disabled.
[WARNING] [nordnm.nordnm]: Kill-switch disabled for accurate benchmarking. Your connection is not secure until these are re-enabled.
[INFO] [nordnm.nordnm]: Benchmarking 35 servers...
[INFO] 35/35 benchmarks finished.
[INFO] [nordnm.nordnm]: Benchmarked 34 servers successfully (97.14%). Took 1.21 seconds.
[INFO] [nordnm.nordnm]: No active connections to remove.
[INFO] [nordnm.nordnm]: Adding new connections...
[INFO] [nordnm.nordnm]: 1 new connections added.
[INFO] [nordnm.networkmanager]: Network kill-switch enabled.
[INFO] [nordnm.nordnm]: Auto-connect enabled for 'fi28 [normal|p2p] [udp]' (Load: 10%, Latency: 122.88s).
chadsr commented 5 years ago

Great, I will close this then. Feel free to re-open it if you have any related issues.

WieFel commented 5 years ago

Unfortunately I'm having still the same problem on my freshly installed Manjaro, trying to sync the servers:

~ >>> sudo nordnm s -s                                                                                                                                                                                                                      
[sudo] password for felix: 
[ERROR] [nordnm.utils]: Could not check PyPi for latest version.
     _   _               _ _   _ ___  ___
    | \ | |             | | \ | ||  \/  |
    |  \| | ___  _ __ __| |  \| || .  . |
    | . ` |/ _ \| '__/ _` | . ` || |\/| |
    | |\  | (_) | | | (_| | |\  || |  | |
    \_| \_/\___/|_|  \__,_\_| \_/\_|  |_/   v0.6.1

[INFO] [nordnm.nordnm]: Checking for new connections to import...
[INFO] [nordnm.nordnm]: Benchmarking slow mode enabled.
[INFO] [nordnm.nordnm]: Benchmarking 4636 servers...
[INFO] 4636/4636 benchmarks finished.
[INFO] [nordnm.nordnm]: Benchmarked 4422 servers successfully (95.38%). Took 633.09 seconds.
[INFO] [nordnm.nordnm]: Removing all active connections...
[INFO] [nordnm.nordnm]: Adding new connections...
[ERROR] [nordnm.nordnm]: list index out of range
[WARNING] [nordnm.nordnm]: Could not find a configuration file for se270 [normal|p2p] [udp]. Skipping.
[ERROR] [nordnm.nordnm]: list index out of range
[WARNING] [nordnm.nordnm]: Could not find a configuration file for se270 [normal|p2p] [tcp]. Skipping.
[ERROR] [nordnm.nordnm]: list index out of range
[WARNING] [nordnm.nordnm]: Could not find a configuration file for se270 [normal|p2p] [udp]. Skipping.
[ERROR] [nordnm.nordnm]: list index out of range
[WARNING] [nordnm.nordnm]: Could not find a configuration file for se270 [normal|p2p] [tcp]. Skipping.
[ERROR] [nordnm.nordnm]: list index out of range
[WARNING] [nordnm.nordnm]: Could not find a configuration file for dk99 [normal|p2p] [udp]. Skipping.
[ERROR] [nordnm.nordnm]: list index out of range
[WARNING] [nordnm.nordnm]: Could not find a configuration file for dk99 [normal|p2p] [tcp]. Skipping.
[ERROR] [nordnm.nordnm]: list index out of range
[WARNING] [nordnm.nordnm]: Could not find a configuration file for dk99 [normal|p2p] [udp]. Skipping.
[ERROR] [nordnm.nordnm]: list index out of range
[WARNING] [nordnm.nordnm]: Could not find a configuration file for dk99 [normal|p2p] [tcp]. Skipping.
...
~ >>> sudo nordnm --v
0.6.1
~ >>> NetworkManager -V
1.16.0-1
~ >>> uname -a
Linux felix-pc 5.0.3-1-MANJARO #1 SMP PREEMPT Tue Mar 19 18:26:12 UTC 2019 x86_64 GNU/Linux
~ >>> python -V
Python 3.7.2
chadsr commented 5 years ago

Hi WieFel,

Could you try running the command with the update flag, just to see if the missing configuration files are re-downloaded? Like so: sudo nordnm s -su

I will be releasing a little patch to make updating the configs automatic instead of requiring an extra flag shortly.

WieFel commented 5 years ago

Thank you, that helped! It was my fault to not add the -u flag. But as you say, I didn't know I had to do that...

chadsr commented 5 years ago

Great!

Yeah, I'm not sure what my original line of thought was when making that opt-in, instead of opt-out. The -u flag will no longer be necessary in a couple of days when I have v0.7.0 out!