Rafficer / linux-cli-community

Linux command-line client for ProtonVPN. Written in Python.
https://protonvpn.com
GNU General Public License v3.0
1.29k stars 194 forks source link

[BUG] [Errno 2] No such file or directory: 'iptables-save': 'iptables-save' #251

Open erajtob opened 3 years ago

erajtob commented 3 years ago

I was trying to use protonvpn-cli on a Raspberry Pi 4 with DietPi OS, however upon trying to connect to any server I was getting this error.

Traceback (most recent call last): File "/usr/local/bin/protonvpn", line 10, in sys.exit(main()) File "/usr/local/lib/python3.7/dist-packages/protonvpn_cli/cli.py", line 73, in main cli() File "/usr/local/lib/python3.7/dist-packages/protonvpn_cli/cli.py", line 114, in cli connection.random_c(protocol) File "/usr/local/lib/python3.7/dist-packages/protonvpn_cli/connection.py", line 139, in random_c openvpn_connect(servername, protocol) File "/usr/local/lib/python3.7/dist-packages/protonvpn_cli/connection.py", line 501, in openvpn_connect port=port[protocol.lower()]) File "/usr/local/lib/python3.7/dist-packages/protonvpn_cli/connection.py", line 811, in manage_killswitch stdout=subprocess.PIPE) File "/usr/lib/python3.7/subprocess.py", line 472, in run with Popen(*popenargs, **kwargs) as process: File "/usr/lib/python3.7/subprocess.py", line 775, in init restore_signals, start_new_session) File "/usr/lib/python3.7/subprocess.py", line 1522, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) FileNotFoundError: [Errno 2] No such file or directory: 'iptables-save': 'iptables-save'

Steps to reproduce the behavior:

  1. Install & Initialize protonvpn-cli tool on DietPi OS using any means,
  2. Try connecting to any server
  3. Will output the ERROR above.

After doing a bit of research I figured it was happening due to the minimal nature of the image and it not having iptables-persistent properly setup, so installing that fixed the issue. Steps to fix issue:

  1. sudo apt-get install iptables-persistent
  2. Reboot machine.
  3. Should be working.

    • OS: DietPi v6.33.3
    • Python Version: 3.7.3
    • ProtonVPN-CLI Version: 2.2.4
erajtob commented 3 years ago

Just wanted to put it out here if anyone else stumbles into it.

jannikmi commented 2 years ago

Thanks for posting it. Had the same problem after deploying container to AWS (locally it worked) and

ENV DEBIAN_FRONTEND='noninteractive'
RUN apt-get update
RUN apt-get install -y openvpn
RUN apt-get install -y iptables-persistent

worked for me.

saharakks commented 4 months ago

my-proxy-0 | Traceback (most recent call last): my-proxy-0 | File "/usr/bin/protonvpn", line 33, in my-proxy-0 | Connecting to BD#24 via UDP... my-proxy-0 | sys.exit(load_entry_point('protonvpn-cli==2.2.12', 'console_scripts', 'protonvpn')()) my-proxy-0 | File "/usr/lib/python3.10/site-packages/protonvpn_cli/cli.py", line 72, in main my-proxy-0 | cli() my-proxy-0 | File "/usr/lib/python3.10/site-packages/protonvpn_cli/cli.py", line 119, in cli my-proxy-0 | connection.random_c(protocol) my-proxy-0 | File "/usr/lib/python3.10/site-packages/protonvpn_cli/connection.py", line 155, in random_c my-proxy-0 | openvpn_connect(servername, protocol) my-proxy-0 | File "/usr/lib/python3.10/site-packages/protonvpn_cli/connection.py", line 517, in openvpn_connect my-proxy-0 | manage_ipv6("disable") my-proxy-0 | File "/usr/lib/python3.10/site-packages/protonvpn_cli/connection.py", line 677, in manage_ipv6 my-proxy-0 | ip6tables_rules = subprocess.run(["ip6tables-save"], my-proxy-0 | File "/usr/lib/python3.10/subprocess.py", line 503, in run my-proxy-0 | with Popen(*popenargs, **kwargs) as process: my-proxy-0 | File "/usr/lib/python3.10/subprocess.py", line 971, in init my-proxy-0 | self._execute_child(args, executable, preexec_fn, close_fds, my-proxy-0 | File "/usr/lib/python3.10/subprocess.py", line 1863, in _execute_child my-proxy-0 | raise child_exception_type(errno_num, err_msg, err_filename) my-proxy-0 | FileNotFoundError: [Errno 2] No such file or directory: 'ip6tables-save' my-proxy-0 | ln: failed to create symbolic link '/app/proton-privoxy/templates': File exists

Need suggestion how to fix this