linux-cli-community icon indicating copy to clipboard operation
linux-cli-community copied to clipboard

[BUG] Not fetching server list

Open autogris opened this issue 4 months ago • 2 comments

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):

  • OS: Slackware-current rolling version
  • Python Version: 3.11.10
  • ProtonVPN-CLI Version: 2.2.12

Additional context

autogris avatar Sep 27 '24 15:09 autogris