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 195 forks source link

[BUG] Not fetching server list #374

Open autogris opened 17 hours ago

autogris commented 17 hours ago

Describe the bug Program stopped connecting today without any changes, throwing the following error:

[!] No Server in country NL found
[!] Please choose a valid country

Same happens with other country codes May be related to this: https://github.com/Rafficer/linux-cli-community/issues/342

To Reproduce Steps to reproduce the behavior:

  1. Open terminal
  2. Invoke the program with protonvpn c --cc nl -p udp, or any other country
  3. Program says won't find server in country

Expected behavior Program should connect to the vpn

Error Messages/Program Output/Log Messages (~/.pvpn-cli/pvpn-cli.log) pvpn-cli.log:

2024-09-27 12:44:23,784 — protonvpn-cli — DEBUG — cli:89 — ###########################
2024-09-27 12:44:23,784 — protonvpn-cli — DEBUG — cli:90 — ### NEW PROCESS STARTED ###
2024-09-27 12:44:23,784 — protonvpn-cli — DEBUG — cli:91 — ###########################
2024-09-27 12:44:23,784 — protonvpn-cli — DEBUG — cli:92 — ['/usr/bin/protonvpn', 'c', '--cc', 'nl', '-p', 'tcp']
2024-09-27 12:44:23,784 — protonvpn-cli — DEBUG — cli:93 — USER: user
2024-09-27 12:44:23,784 — protonvpn-cli — DEBUG — cli:94 — CONFIG_DIR: /home/[redacted]/.pvpn-cli
2024-09-27 12:44:23,786 — protonvpn-cli — DEBUG — cli:97 — Arguments
{'--cc': 'nl', '--fastest': False, '--help': False, '--p2p': False, '--random': False, '--sc': False, '--tor': False, '--version': False, '-p': 'tcp', '<servername>': None, 'c': True, 'configure': False, 'connect': False, 'd': False, 'disconnect': False, 'examples': False, 'init': False, 'r': False, 'reconnect': False, 'refresh': False, 's': False, 'status': False}
2024-09-27 12:44:23,793 — protonvpn-cli — DEBUG — country_f:186 — Starting fastest country connect
2024-09-27 12:44:23,793 — protonvpn-cli — DEBUG — disconnect:323 — Initiating disconnect
2024-09-27 12:44:23,821 — protonvpn-cli — DEBUG — is_connected:202 — Checking connection Status. OpenVPN processes: 0
2024-09-27 12:44:23,821 — protonvpn-cli — DEBUG — manage_dns:624 — Restoring DNS
2024-09-27 12:44:23,821 — protonvpn-cli — DEBUG — manage_dns:641 — No Backupfile found
2024-09-27 12:44:23,821 — protonvpn-cli — DEBUG — manage_ipv6:704 — Restoring ip6tables
2024-09-27 12:44:23,821 — protonvpn-cli — DEBUG — manage_ipv6:719 — No Backupfile found
2024-09-27 12:44:23,821 — protonvpn-cli — DEBUG — manage_killswitch:794 — Restoring iptables
2024-09-27 12:44:23,821 — protonvpn-cli — DEBUG — manage_killswitch:803 — No Backupfile found
2024-09-27 12:44:23,821 — protonvpn-cli — DEBUG — disconnect:363 — No connection found
2024-09-27 12:44:23,827 — protonvpn-cli — DEBUG — call_api:38 — Initiating API Call: https://api.protonvpn.ch/vpn/logicals
2024-09-27 12:44:27,858 — protonvpn-cli — DEBUG — call_api:72 — Successful json response
2024-09-27 12:44:28,132 — protonvpn-cli — DEBUG — pull_server_data:94 — SERVER_INFO_FILE written
2024-09-27 12:44:28,144 — protonvpn-cli — DEBUG — pull_server_data:101 — last_api_call updated
2024-09-27 12:44:28,148 — protonvpn-cli — DEBUG — get_servers:108 — Reading servers from file
2024-09-27 12:44:28,207 — protonvpn-cli — DEBUG — country_f:212 — No server in country NL

By running protonvpn connect -f I get the following:

Traceback (most recent call last):
  File "/usr/bin/protonvpn", line 33, in <module>
    sys.exit(load_entry_point('protonvpn-cli', 'console_scripts', 'protonvpn')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/protonvpn-cli-community/protonvpn_cli/cli.py", line 72, in main
    cli()
  File "/opt/protonvpn-cli-community/protonvpn_cli/cli.py", line 121, in cli
    connection.fastest(protocol)
  File "/opt/protonvpn-cli-community/protonvpn_cli/connection.py", line 180, in fastest
    fastest_server = get_fastest_server(server_pool)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/protonvpn-cli-community/protonvpn_cli/utils.py", line 180, in get_fastest_server
    fastest_server = random.choice(fastest_pool[:pool_size])["Name"]
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/random.py", line 373, in choice
    raise IndexError('Cannot choose from an empty sequence')
IndexError: Cannot choose from an empty sequence

Desktop (please complete the following information):

Additional context

mara004 commented 17 hours ago

Same issue on Fedora 37. protonvpn connect -f produces the above IndexError. And when invoking just protonvpn connect, I get the DialogError as in #342.

Note, upstream has abandoned F37, so I'm not able to use the official client. Trying to use the legacy https://repo.protonvpn.com/fedora-37-stable/ repo led to GPG issues.

autogris commented 16 hours ago

I also can't use official client because it requires systemd, which my distro don't use.