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

[BUG] protonvpn stuck on 'Connected!'

Open thomaspdt opened this issue 3 years ago • 14 comments

Describe the bug Sometimes, when I connect to a protonvpn server (secure core or not), the command-line is stuck on 'Connected!' and doesn't return the prompt in the terminal to type a new command. If I open a new terminal window and look at protonvpn status, it says that it is connected indeed. Once, I remember that after waiting a few minutes, protonvpn gave me back the prompt in terminal.

Unfortunately, it's difficult to reproduce because it doesn't happen all the time.

To Reproduce Steps to reproduce the behavior:

  1. sudo protonvpn c ...

Expected behavior When protonvpn is connected to a server, I should be able to enter a new command in the same terminal window I used to connect to the vpn.

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

2020-08-03 09:12:27,634 — protonvpn-cli — DEBUG — cli:84 — ###########################
2020-08-03 09:12:27,634 — protonvpn-cli — DEBUG — cli:85 — ### NEW PROCESS STARTED ###
2020-08-03 09:12:27,635 — protonvpn-cli — DEBUG — cli:86 — ###########################
2020-08-03 09:12:27,635 — protonvpn-cli — DEBUG — cli:87 — ['/usr/local/bin/protonvpn', 'c', '--c', 'be']
2020-08-03 09:12:27,635 — protonvpn-cli — DEBUG — cli:88 — USER: USERNAME
2020-08-03 09:12:27,635 — protonvpn-cli — DEBUG — cli:89 — CONFIG_DIR: /home/USERNAME/.pvpn-cli
2020-08-03 09:12:27,638 — protonvpn-cli — DEBUG — cli:92 — Arguments
{'--cc': 'be', '--fastest': False, '--help': False, '--p2p': False, '--random': False, '--sc': False, '--tor': False, '--version': False, '-p': None, '<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}
2020-08-03 09:12:27,646 — protonvpn-cli — DEBUG — country_f:170 — Starting fastest country connect
2020-08-03 09:12:27,647 — protonvpn-cli — DEBUG — disconnect:307 — Initiating disconnect
2020-08-03 09:12:27,654 — protonvpn-cli — DEBUG — is_connected:197 — Checking connection Status. OpenVPN processes: 0
2020-08-03 09:12:27,654 — protonvpn-cli — DEBUG — manage_dns:606 — Restoring DNS
2020-08-03 09:12:27,655 — protonvpn-cli — DEBUG — manage_dns:623 — No Backupfile found
2020-08-03 09:12:27,655 — protonvpn-cli — DEBUG — manage_ipv6:686 — Restoring ip6tables
2020-08-03 09:12:27,655 — protonvpn-cli — DEBUG — manage_ipv6:701 — No Backupfile found
2020-08-03 09:12:27,655 — protonvpn-cli — DEBUG — manage_killswitch:776 — Restoring iptables
2020-08-03 09:12:27,655 — protonvpn-cli — DEBUG — manage_killswitch:785 — No Backupfile found
2020-08-03 09:12:27,655 — protonvpn-cli — DEBUG — disconnect:347 — No connection found
2020-08-03 09:12:27,655 — protonvpn-cli — DEBUG — call_api:36 — Initiating API Call: https://api.protonvpn.ch/vpn/logicals
2020-08-03 09:12:28,211 — protonvpn-cli — DEBUG — call_api:65 — Successful json response
2020-08-03 09:12:28,283 — protonvpn-cli — DEBUG — pull_server_data:87 — SERVER_INFO_FILE written
2020-08-03 09:12:28,288 — protonvpn-cli — DEBUG — pull_server_data:94 — last_api_call updated
2020-08-03 09:12:28,290 — protonvpn-cli — DEBUG — get_servers:101 — Reading servers from file
2020-08-03 09:12:28,296 — protonvpn-cli — DEBUG — get_fastest_server:171 — Returning fastest server with pool size 1
2020-08-03 09:12:28,296 — protonvpn-cli — DEBUG — openvpn_connect:442 — Initiating OpenVPN connection
2020-08-03 09:12:28,296 — protonvpn-cli — DEBUG — openvpn_connect:444 — Connecting to BE#8 via UDP
2020-08-03 09:12:28,296 — protonvpn-cli — DEBUG — get_servers:101 — Reading servers from file
2020-08-03 09:12:28,309 — protonvpn-cli — DEBUG — render_j2_template:255 — Rendered /home/USERNAME/.pvpn-cli/connect.ovpn from openvpn_template.j2
2020-08-03 09:12:28,314 — protonvpn-cli — DEBUG — disconnect:307 — Initiating disconnect
2020-08-03 09:12:28,322 — protonvpn-cli — DEBUG — is_connected:197 — Checking connection Status. OpenVPN processes: 0
2020-08-03 09:12:28,323 — protonvpn-cli — DEBUG — manage_dns:606 — Restoring DNS
2020-08-03 09:12:28,323 — protonvpn-cli — DEBUG — manage_dns:623 — No Backupfile found
2020-08-03 09:12:28,323 — protonvpn-cli — DEBUG — manage_ipv6:686 — Restoring ip6tables
2020-08-03 09:12:28,323 — protonvpn-cli — DEBUG — manage_ipv6:701 — No Backupfile found
2020-08-03 09:12:28,323 — protonvpn-cli — DEBUG — manage_killswitch:776 — Restoring iptables
2020-08-03 09:12:28,323 — protonvpn-cli — DEBUG — manage_killswitch:785 — No Backupfile found
2020-08-03 09:12:28,323 — protonvpn-cli — DEBUG — disconnect:347 — No connection found
2020-08-03 09:12:28,323 — protonvpn-cli — DEBUG — get_ip_info:143 — Getting IP Information
2020-08-03 09:12:28,323 — protonvpn-cli — DEBUG — call_api:36 — Initiating API Call: https://api.protonvpn.ch/vpn/location
2020-08-03 09:12:28,507 — protonvpn-cli — DEBUG — call_api:65 — Successful json response
2020-08-03 09:12:28,513 — protonvpn-cli — DEBUG — openvpn_connect:474 — OpenVPN process started
2020-08-03 09:12:29,821 — protonvpn-cli — DEBUG — set_config_value:134 — Writing dns_server to [metadata] in config file
2020-08-03 09:12:29,821 — protonvpn-cli — DEBUG — manage_dns:554 — Leak Protection initiated
2020-08-03 09:12:29,822 — protonvpn-cli — DEBUG — manage_dns:568 — DNS Leak Protection is enabled
2020-08-03 09:12:29,823 — protonvpn-cli — DEBUG — manage_dns:574 — /run/systemd/resolve/stub-resolv.conf (resolv.conf) backed up
2020-08-03 09:12:29,824 — protonvpn-cli — DEBUG — manage_dns:585 — Removed existing DNS Servers
2020-08-03 09:12:29,824 — protonvpn-cli — DEBUG — manage_dns:593 — Added ProtonVPN or custom DNS
2020-08-03 09:12:29,825 — protonvpn-cli — DEBUG — set_config_value:134 — Writing resolvconf_hash to [metadata] in config file
2020-08-03 09:12:29,825 — protonvpn-cli — DEBUG — manage_ipv6:643 — Disabling IPv6
2020-08-03 09:12:29,829 — protonvpn-cli — DEBUG — manage_ipv6:658 — Backing up ip6tables rules
2020-08-03 09:12:29,840 — protonvpn-cli — DEBUG — manage_ipv6:683 — IPv6 disabled successfully
2020-08-03 09:12:29,841 — protonvpn-cli — DEBUG — manage_killswitch:809 — Backing up iptables rules
2020-08-03 09:12:30,046 — protonvpn-cli — DEBUG — manage_killswitch:860 — Kill Switch enabled
2020-08-03 09:12:30,047 — protonvpn-cli — DEBUG — get_ip_info:143 — Getting IP Information
2020-08-03 09:12:30,049 — protonvpn-cli — DEBUG — call_api:36 — Initiating API Call: https://api.protonvpn.ch/vpn/location
2020-08-03 09:12:30,600 — protonvpn-cli — DEBUG — call_api:65 — Successful json response
2020-08-03 09:12:30,601 — protonvpn-cli — DEBUG — openvpn_connect:508 — Connection successful
2020-08-03 09:12:30,601 — protonvpn-cli — DEBUG — openvpn_connect:527 — Writing connection info to file
2020-08-03 09:28:31,784 — protonvpn-cli — DEBUG — cli:84 — ###########################
2020-08-03 09:28:31,784 — protonvpn-cli — DEBUG — cli:85 — ### NEW PROCESS STARTED ###
2020-08-03 09:28:31,784 — protonvpn-cli — DEBUG — cli:86 — ###########################
2020-08-03 09:28:31,784 — protonvpn-cli — DEBUG — cli:87 — ['/usr/local/bin/protonvpn', 'd']
2020-08-03 09:28:31,784 — protonvpn-cli — DEBUG — cli:88 — USER: USERNAME
2020-08-03 09:28:31,784 — protonvpn-cli — DEBUG — cli:89 — CONFIG_DIR: /home/USERNAME/.pvpn-cli
2020-08-03 09:28:31,787 — protonvpn-cli — DEBUG — cli:92 — Arguments
{'--cc': None, '--fastest': False, '--help': False, '--p2p': False, '--random': False, '--sc': False, '--tor': False, '--version': False, '-p': None, '<servername>': None, 'c': False, 'configure': False, 'connect': False, 'd': True, 'disconnect': False, 'examples': False, 'init': False, 'r': False, 'reconnect': False, 'refresh': False, 's': False, 'status': False}
2020-08-03 09:28:31,795 — protonvpn-cli — DEBUG — disconnect:307 — Initiating disconnect
2020-08-03 09:28:31,803 — protonvpn-cli — DEBUG — is_connected:197 — Checking connection Status. OpenVPN processes: 1
2020-08-03 09:28:32,320 — protonvpn-cli — DEBUG — is_connected:197 — Checking connection Status. OpenVPN processes: 0
2020-08-03 09:28:32,329 — protonvpn-cli — DEBUG — is_connected:197 — Checking connection Status. OpenVPN processes: 0
2020-08-03 09:28:32,329 — protonvpn-cli — DEBUG — manage_dns:606 — Restoring DNS
2020-08-03 09:28:32,330 — protonvpn-cli — DEBUG — manage_dns:616 — resolv.conf restored from backup
2020-08-03 09:28:32,330 — protonvpn-cli — DEBUG — manage_dns:621 — resolv.conf.backup removed
2020-08-03 09:28:32,330 — protonvpn-cli — DEBUG — manage_ipv6:686 — Restoring ip6tables
2020-08-03 09:28:32,332 — protonvpn-cli — DEBUG — manage_ipv6:697 — ip6tables restored
2020-08-03 09:28:32,332 — protonvpn-cli — DEBUG — manage_ipv6:699 — ip6tables.backup removed
2020-08-03 09:28:32,332 — protonvpn-cli — DEBUG — manage_killswitch:776 — Restoring iptables
2020-08-03 09:28:32,333 — protonvpn-cli — DEBUG — manage_killswitch:778 — Restoring IPTables rules
2020-08-03 09:28:32,354 — protonvpn-cli — DEBUG — manage_killswitch:781 — iptables restored
2020-08-03 09:28:32,354 — protonvpn-cli — DEBUG — manage_killswitch:783 — iptables.backup removed
2020-08-03 09:28:32,354 — protonvpn-cli — DEBUG — disconnect:338 — Disconnected

Desktop (please complete the following information):

  • OS: Linux Mint 19 Cinnamon
  • Python Version: Python 3.6.9
  • ProtonVPN-CLI Version: ProtonVPN-CLI v2.2.4

thomaspdt avatar Aug 03 '20 10:08 thomaspdt

Please fully fill out the issue template and provide the necessary information.

Rafficer avatar Aug 03 '20 10:08 Rafficer

Please fully fill out the issue template and provide the necessary information.

Done.

thomaspdt avatar Aug 03 '20 11:08 thomaspdt

Is this log file from a time when this did happen? I expected it to check for updates when it happened.

Rafficer avatar Aug 03 '20 12:08 Rafficer

Is this log file from a time when this did happen? I expected it to check for updates when it happened.

Yes, it is.

thomaspdt avatar Aug 03 '20 12:08 thomaspdt

Here are more details about this issue when I have tried connecting to a VPN server this morning:

I connect for the first time today to a VPN server using: sudo protonvpn c --sc. Then, the terminal is stuck on: Connected! but doesn't give me back a prompt to enter another command. For that, I need to hit Ctrl+Z to be able to use the terminal again but that's when the VPN process could not be terminated. Whatever command I tried after that didn't work, even if I just tried to disconnect with 'sudo protonvpn d', I would get the following error: [!] Could not terminate OpenVPN process. To solve this, I had to enter the following commands:

pgrep protonvpn
sudo kill <protonvpn-PID>

Then, I can use again the protonvpn-cli normally. I have tried sudo kill <pvpn-PID> or sudo kill kill <openvpn-PID> and to reconnect after entering those commands, it didn't work. Only sudo kill <protonvpn-PID> worked.

Anyone still working on this issue?

thomaspdt avatar Sep 25 '20 08:09 thomaspdt

Having the same issue. Takes 3-4 minutes after printing "Connected!" to exit. See logs (last few lines), it seems to get stuck on get_latest_version.

Logs
2020-10-01 21:31:31,877 — protonvpn-cli — DEBUG — cli:85 — ### NEW PROCESS STARTED ###
2020-10-01 21:31:31,877 — protonvpn-cli — DEBUG — cli:86 — ###########################
2020-10-01 21:31:31,877 — protonvpn-cli — DEBUG — cli:87 — ['/usr/bin/protonvpn', 'c', '-f']
2020-10-01 21:31:31,877 — protonvpn-cli — DEBUG — cli:88 — USER: *****
2020-10-01 21:31:31,877 — protonvpn-cli — DEBUG — cli:89 — CONFIG_DIR: /home/*****/.pvpn-cli
2020-10-01 21:31:31,881 — protonvpn-cli — DEBUG — cli:92 — Arguments
{'--cc': None, '--fastest': True, '--help': False, '--p2p': False, '--random': False, '--sc': False, '--tor': False, '--version': False, '-p': None, '<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}
2020-10-01 21:31:31,891 — protonvpn-cli — DEBUG — fastest:145 — Starting fastest connect
2020-10-01 21:31:31,892 — protonvpn-cli — DEBUG — disconnect:307 — Initiating disconnect
2020-10-01 21:31:31,903 — protonvpn-cli — DEBUG — is_connected:195 — Checking connection Status. OpenVPN processes: 0
2020-10-01 21:31:31,903 — protonvpn-cli — DEBUG — manage_dns:606 — Restoring DNS
2020-10-01 21:31:31,903 — protonvpn-cli — DEBUG — manage_dns:623 — No Backupfile found
2020-10-01 21:31:31,904 — protonvpn-cli — DEBUG — manage_ipv6:686 — Restoring ip6tables
2020-10-01 21:31:31,904 — protonvpn-cli — DEBUG — manage_ipv6:701 — No Backupfile found
2020-10-01 21:31:31,904 — protonvpn-cli — DEBUG — manage_killswitch:776 — Restoring iptables
2020-10-01 21:31:31,904 — protonvpn-cli — DEBUG — manage_killswitch:785 — No Backupfile found
2020-10-01 21:31:31,904 — protonvpn-cli — DEBUG — disconnect:347 — No connection found
2020-10-01 21:31:31,904 — protonvpn-cli — DEBUG — call_api:36 — Initiating API Call: https://api.protonvpn.ch/vpn/logicals
2020-10-01 21:31:32,926 — protonvpn-cli — DEBUG — call_api:65 — Successful json response
2020-10-01 21:31:32,971 — protonvpn-cli — DEBUG — pull_server_data:87 — SERVER_INFO_FILE written
2020-10-01 21:31:32,977 — protonvpn-cli — DEBUG — pull_server_data:94 — last_api_call updated
2020-10-01 21:31:32,979 — protonvpn-cli — DEBUG — get_servers:101 — Reading servers from file
2020-10-01 21:31:32,987 — protonvpn-cli — DEBUG — get_fastest_server:170 — Returning fastest server with pool size 1
2020-10-01 21:31:32,987 — protonvpn-cli — DEBUG — openvpn_connect:442 — Initiating OpenVPN connection
2020-10-01 21:31:32,987 — protonvpn-cli — DEBUG — openvpn_connect:443 — Connecting to US-FREE#1 via UDP
2020-10-01 21:31:32,987 — protonvpn-cli — DEBUG — get_servers:101 — Reading servers from file
2020-10-01 21:31:33,003 — protonvpn-cli — DEBUG — render_j2_template:255 — Rendered /home/*****/.pvpn-cli/connect.ovpn from openvpn_template.j2
2020-10-01 21:31:33,008 — protonvpn-cli — DEBUG — disconnect:307 — Initiating disconnect
2020-10-01 21:31:33,020 — protonvpn-cli — DEBUG — is_connected:195 — Checking connection Status. OpenVPN processes: 0
2020-10-01 21:31:33,020 — protonvpn-cli — DEBUG — manage_dns:606 — Restoring DNS
2020-10-01 21:31:33,020 — protonvpn-cli — DEBUG — manage_dns:623 — No Backupfile found
2020-10-01 21:31:33,020 — protonvpn-cli — DEBUG — manage_ipv6:686 — Restoring ip6tables
2020-10-01 21:31:33,020 — protonvpn-cli — DEBUG — manage_ipv6:701 — No Backupfile found
2020-10-01 21:31:33,020 — protonvpn-cli — DEBUG — manage_killswitch:776 — Restoring iptables
2020-10-01 21:31:33,021 — protonvpn-cli — DEBUG — manage_killswitch:785 — No Backupfile found
2020-10-01 21:31:33,021 — protonvpn-cli — DEBUG — disconnect:347 — No connection found
2020-10-01 21:31:33,021 — protonvpn-cli — DEBUG — get_ip_info:143 — Getting IP Information
2020-10-01 21:31:33,021 — protonvpn-cli — DEBUG — call_api:36 — Initiating API Call: https://api.protonvpn.ch/vpn/location
2020-10-01 21:31:33,512 — protonvpn-cli — DEBUG — call_api:65 — Successful json response
2020-10-01 21:31:33,515 — protonvpn-cli — DEBUG — openvpn_connect:474 — OpenVPN process started
2020-10-01 21:31:34,919 — protonvpn-cli — DEBUG — set_config_value:133 — Writing dns_server to [metadata] in config file
2020-10-01 21:31:34,919 — protonvpn-cli — DEBUG — manage_dns:554 — Leak Protection initiated
2020-10-01 21:31:34,920 — protonvpn-cli — DEBUG — manage_dns:568 — DNS Leak Protection is enabled
2020-10-01 21:31:34,920 — protonvpn-cli — DEBUG — manage_dns:574 — /etc/resolv.conf (resolv.conf) backed up
2020-10-01 21:31:34,921 — protonvpn-cli — DEBUG — manage_dns:585 — Removed existing DNS Servers
2020-10-01 21:31:34,921 — protonvpn-cli — DEBUG — manage_dns:593 — Added ProtonVPN or custom DNS
2020-10-01 21:31:34,921 — protonvpn-cli — DEBUG — set_config_value:133 — Writing resolvconf_hash to [metadata] in config file
2020-10-01 21:31:34,921 — protonvpn-cli — DEBUG — manage_ipv6:643 — Disabling IPv6
2020-10-01 21:31:34,924 — protonvpn-cli — DEBUG — manage_ipv6:658 — Backing up ip6tables rules
2020-10-01 21:31:34,940 — protonvpn-cli — DEBUG — manage_ipv6:683 — IPv6 disabled successfully
2020-10-01 21:31:34,942 — protonvpn-cli — DEBUG — manage_killswitch:809 — Backing up iptables rules
2020-10-01 21:31:34,975 — protonvpn-cli — DEBUG — manage_killswitch:860 — Kill Switch enabled
2020-10-01 21:31:34,975 — protonvpn-cli — DEBUG — get_ip_info:143 — Getting IP Information
2020-10-01 21:31:34,976 — protonvpn-cli — DEBUG — call_api:36 — Initiating API Call: https://api.protonvpn.ch/vpn/location
2020-10-01 21:31:35,593 — protonvpn-cli — DEBUG — call_api:65 — Successful json response
2020-10-01 21:31:35,593 — protonvpn-cli — DEBUG — openvpn_connect:508 — Connection successful
2020-10-01 21:31:35,593 — protonvpn-cli — DEBUG — openvpn_connect:527 — Writing connection info to file
2020-10-01 21:31:35,595 — protonvpn-cli — DEBUG — check_update:384 — Checking for new update
2020-10-01 21:31:35,595 — protonvpn-cli — DEBUG — check_update:387 — Current: [2, 2, 4]
2020-10-01 21:31:35,595 — protonvpn-cli — DEBUG — get_latest_version:356 — Calling pypi API
2020-10-01 21:35:54,411 — protonvpn-cli — DEBUG — check_update:395 — Latest: [2, 2, 4]
2020-10-01 21:35:54,411 — protonvpn-cli — DEBUG — check_update:407 — No update
2020-10-01 21:35:54,411 — protonvpn-cli — DEBUG — set_config_value:133 — Writing last_update_check to [metadata] in config file

andrewsuzuki avatar Oct 02 '20 01:10 andrewsuzuki

Same issue here, stuck after trying to connect.
This worked the other day, not sure what happened.

Log

2020-10-02 12:15:49,113 — protonvpn-cli — DEBUG — cli:84 — ###########################
2020-10-02 12:15:49,114 — protonvpn-cli — DEBUG — cli:85 — ### NEW PROCESS STARTED ###
2020-10-02 12:15:49,114 — protonvpn-cli — DEBUG — cli:86 — ###########################
2020-10-02 12:15:49,114 — protonvpn-cli — DEBUG — cli:87 — ['/usr/local/bin/protonvpn', 'c', '-f']
2020-10-02 12:15:49,115 — protonvpn-cli — DEBUG — cli:88 — USER: USERNAME
2020-10-02 12:15:49,115 — protonvpn-cli — DEBUG — cli:89 — CONFIG_DIR: /home/USERNAME/.pvpn-cli
2020-10-02 12:15:49,127 — protonvpn-cli — DEBUG — cli:92 — Arguments
{'--cc': None, '--fastest': True, '--help': False, '--p2p': False, '--random': False, '--sc': False, '--tor': False, '--version': False, '-p': None, '<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}
2020-10-02 12:15:49,173 — protonvpn-cli — DEBUG — fastest:145 — Starting fastest connect
2020-10-02 12:15:49,174 — protonvpn-cli — DEBUG — disconnect:307 — Initiating disconnect
2020-10-02 12:15:49,394 — protonvpn-cli — DEBUG — is_connected:195 — Checking connection Status. OpenVPN processes: 0
2020-10-02 12:15:49,395 — protonvpn-cli — DEBUG — manage_dns:606 — Restoring DNS
2020-10-02 12:15:49,397 — protonvpn-cli — DEBUG — manage_dns:618 — resolv.conf changed. Not restoring.
2020-10-02 12:15:49,397 — protonvpn-cli — DEBUG — manage_dns:621 — resolv.conf.backup removed
2020-10-02 12:15:49,397 — protonvpn-cli — DEBUG — manage_ipv6:686 — Restoring ip6tables
2020-10-02 12:15:49,409 — protonvpn-cli — DEBUG — manage_ipv6:697 — ip6tables restored
2020-10-02 12:15:49,410 — protonvpn-cli — DEBUG — manage_ipv6:699 — ip6tables.backup removed
2020-10-02 12:15:49,411 — protonvpn-cli — DEBUG — manage_killswitch:776 — Restoring iptables
2020-10-02 12:15:49,411 — protonvpn-cli — DEBUG — manage_killswitch:785 — No Backupfile found
2020-10-02 12:15:49,411 — protonvpn-cli — DEBUG — disconnect:347 — No connection found
2020-10-02 12:15:49,414 — protonvpn-cli — DEBUG — call_api:36 — Initiating API Call: https://api.protonvpn.ch/vpn/logicals
2020-10-02 12:15:49,960 — protonvpn-cli — DEBUG — call_api:65 — Successful json response
2020-10-02 12:15:50,126 — protonvpn-cli — DEBUG — pull_server_data:87 — SERVER_INFO_FILE written
2020-10-02 12:15:50,156 — protonvpn-cli — DEBUG — pull_server_data:94 — last_api_call updated
2020-10-02 12:15:50,161 — protonvpn-cli — DEBUG — get_servers:101 — Reading servers from file
2020-10-02 12:15:50,191 — protonvpn-cli — DEBUG — get_fastest_server:170 — Returning fastest server with pool size 4
2020-10-02 12:15:50,191 — protonvpn-cli — DEBUG — openvpn_connect:442 — Initiating OpenVPN connection
2020-10-02 12:15:50,191 — protonvpn-cli — DEBUG — openvpn_connect:443 — Connecting to DE#15 via UDP
2020-10-02 12:15:50,192 — protonvpn-cli — DEBUG — get_servers:101 — Reading servers from file
2020-10-02 12:15:50,247 — protonvpn-cli — DEBUG — render_j2_template:255 — Rendered /home/USERNAME/.pvpn-cli/connect.ovpn from openvpn_template.j2
2020-10-02 12:15:50,272 — protonvpn-cli — DEBUG — disconnect:307 — Initiating disconnect
2020-10-02 12:15:50,490 — protonvpn-cli — DEBUG — is_connected:195 — Checking connection Status. OpenVPN processes: 0
2020-10-02 12:15:50,490 — protonvpn-cli — DEBUG — manage_dns:606 — Restoring DNS
2020-10-02 12:15:50,491 — protonvpn-cli — DEBUG — manage_dns:623 — No Backupfile found
2020-10-02 12:15:50,491 — protonvpn-cli — DEBUG — manage_ipv6:686 — Restoring ip6tables
2020-10-02 12:15:50,491 — protonvpn-cli — DEBUG — manage_ipv6:701 — No Backupfile found
2020-10-02 12:15:50,491 — protonvpn-cli — DEBUG — manage_killswitch:776 — Restoring iptables
2020-10-02 12:15:50,492 — protonvpn-cli — DEBUG — manage_killswitch:785 — No Backupfile found
2020-10-02 12:15:50,492 — protonvpn-cli — DEBUG — disconnect:347 — No connection found
2020-10-02 12:15:50,492 — protonvpn-cli — DEBUG — get_ip_info:143 — Getting IP Information
2020-10-02 12:15:50,494 — protonvpn-cli — DEBUG — call_api:36 — Initiating API Call: https://api.protonvpn.ch/vpn/location
2020-10-02 12:15:50,733 — protonvpn-cli — DEBUG — call_api:65 — Successful json response
2020-10-02 12:15:50,740 — protonvpn-cli — DEBUG — openvpn_connect:474 — OpenVPN process started
2020-10-02 12:15:52,253 — protonvpn-cli — DEBUG — set_config_value:133 — Writing dns_server to [metadata] in config file
2020-10-02 12:15:52,254 — protonvpn-cli — DEBUG — manage_dns:554 — Leak Protection initiated
2020-10-02 12:15:52,256 — protonvpn-cli — DEBUG — manage_dns:568 — DNS Leak Protection is enabled
2020-10-02 12:15:52,258 — protonvpn-cli — DEBUG — manage_dns:574 — /run/systemd/resolve/stub-resolv.conf (resolv.conf) backed up
2020-10-02 12:15:52,259 — protonvpn-cli — DEBUG — manage_dns:585 — Removed existing DNS Servers
2020-10-02 12:15:52,259 — protonvpn-cli — DEBUG — manage_dns:593 — Added ProtonVPN or custom DNS
2020-10-02 12:15:52,261 — protonvpn-cli — DEBUG — set_config_value:133 — Writing resolvconf_hash to [metadata] in config file
2020-10-02 12:15:52,263 — protonvpn-cli — DEBUG — manage_ipv6:643 — Disabling IPv6
2020-10-02 12:15:52,270 — protonvpn-cli — DEBUG — manage_ipv6:658 — Backing up ip6tables rules
2020-10-02 12:15:52,308 — protonvpn-cli — DEBUG — manage_ipv6:683 — IPv6 disabled successfully
2020-10-02 12:15:52,310 — protonvpn-cli — DEBUG — get_ip_info:143 — Getting IP Information
2020-10-02 12:15:52,311 — protonvpn-cli — DEBUG — call_api:36 — Initiating API Call: https://api.protonvpn.ch/vpn/location
2020-10-02 12:15:52,570 — protonvpn-cli — DEBUG — call_api:65 — Successful json response
2020-10-02 12:15:52,572 — protonvpn-cli — DEBUG — openvpn_connect:508 — Connection successful
2020-10-02 12:15:52,573 — protonvpn-cli — DEBUG — openvpn_connect:527 — Writing connection info to file
2020-10-02 12:15:52,577 — protonvpn-cli — DEBUG — check_update:384 — Checking for new update
2020-10-02 12:15:52,577 — protonvpn-cli — DEBUG — check_update:387 — Current: [2, 2, 4]
2020-10-02 12:15:52,577 — protonvpn-cli — DEBUG — get_latest_version:356 — Calling pypi API

moshegottlieb avatar Oct 02 '20 12:10 moshegottlieb

Same problem. I've noticed this issue for months. Fedora 31 on multiple computers. proton cli v2.2.2 and 2.2.4 Python 3.7.9

Trying to disconnect during the connected "hang" produces: Could not terminate OpenVPN process. I would say this hangs for upwards of 10 minutes.

LoganBresnahan avatar Oct 04 '20 23:10 LoganBresnahan

Same issue, also noticed for months. I'm on newest Ubuntu.

Also sporadic, used to happen more, might happen less now or maybe I just open that laptop less.

I've also timed it to hang for around 10 minutes.

Alvynskio avatar Oct 05 '20 23:10 Alvynskio

Not sure what worked for you people, but I have to protonvpn init every time this happens to get it working again.

LouKordos avatar Oct 28 '20 14:10 LouKordos

Just started happening to me this evening, running Ubuntu 20.10; I am using python 3.8.6, using the requests library version 2.23.0.

It took 8 minutes to execute the check_update function, based on the output in pvpn-cli.log:

` 2020-11-07 00:40:04,743 — protonvpn-cli — DEBUG — openvpn_connect:527 — Writing connection info to file 2020-11-07 00:40:04,744 — protonvpn-cli — DEBUG — check_update:384 — Checking for new update 2020-11-07 00:40:04,744 — protonvpn-cli — DEBUG — check_update:387 — Current: [2, 2, 4] 2020-11-07 00:40:04,744 — protonvpn-cli — DEBUG — get_latest_version:356 — Calling pypi API <--- STUCK

...8 minutes later...

2020-11-07 00:48:48,292 — protonvpn-cli — DEBUG — check_update:395 — Latest: [2, 2, 4] 2020-11-07 00:48:48,292 — protonvpn-cli — DEBUG — check_update:407 — No update 2020-11-07 00:48:48,293 — protonvpn-cli — DEBUG — set_config_value:133 — Writing last_update_check to [metadata] in config file `

While waiting, I manually tested the update endpoint with curl/wget (https://pypi.org/pypi/protonvpn-cli/json) and got an immediate response with json (release) data. Not sure why it took so long...?; Maybe add a timeout option, as it doesn't have one by default.

https://github.com/ProtonVPN/linux-cli/blob/494ccd9aa0ec3aca529b582b25a732242c91f542/protonvpn_cli/utils.py#L360 Ref: https://2.python-requests.org/en/master/user/advanced/#timeouts

aheinrich avatar Nov 07 '20 09:11 aheinrich

To anyone reading this issue, if you don't want to run protonvpn init everytime this issue arises, I have a super dirty hack that works in my case. I don't recommend this at all because it's basically exactly what should not be done, but I wanted a quick fix, so here goes: in utils.py, search for def check_update() and just add return at the first LOC of the function body. This will make it not check for latest versions (which would normally be undesirable), and thus skip the issue with the PyPi API request.

LouKordos avatar Nov 07 '20 16:11 LouKordos

I had the same issue of sudo protonvpn c <server_name> being hung after Connected! is printed to the terminal. I am on Ubuntu 20.04 and sudo apt update && upgrade did not help. For me, this made the vpn irritating to use since it never returned. Feature always reproduced itself.

Following @LouKordos, I did sudo protonvpn init. That fixes the issue. I'll post back when it gets too annoying again. Please fix this fea.. bug, @teamproton.

slmatrix avatar Jan 07 '21 14:01 slmatrix

Hey @slmatrix

Since the official Protonvpn cli has been launched, no more commits will be done this repository. Also, the support for it will be limited, as this is a community build.

For more information, please check https://protonvpn.com/blog/linux-vpn-cli-beta/

calexandru2018 avatar Jan 07 '21 17:01 calexandru2018