[GH-ISSUE #1258] Stuck at connecting, no internet after restart, tunnel hanging. See this for fix #486

Closed
opened 2026-10-13 20:22:30 +00:00 by bsakaguchi · 10 comments
Owner

Originally created by @Nodaysofff on GitHub (Nov 17, 2024).
Original GitHub issue: https://github.com/amnezia-vpn/amnezia-client/issues/1258

Describe the bug
App didnt close tunnel, when its quit anyting but its tray icon close button, which makes tunnel to persist after system restart and makes it unable to connect to the server again due to unterminated "tun2socks" process

To Reproduce
Steps to reproduce the behavior:

  1. Just launch app as you usually do and use split tunneling
  2. Click on 'Connect' and wait for app to establish connection to your server
  3. Restart the system
  4. See no internet when you`ve restarted, tun2socks and tunnel hanging, sometimes have app stuck on connecting, etc...

Expected behavior
App should handle scenario when its closed by the system, since now it closes tunnel only when user closes the app from the tray icon or from inside the app

Log files
I`ve described the bug, but in the logs it shows that tun2socks already running and quitting when you stuck at connecting

Desktop:

  • OS: Windows 10
  • Version any

Additional context
At the moment there is only two ways for you to escape such bug, until its fixed in the code:

  1. Before the system shutdown (or anything that will terminate app process) you should close the app manually
  2. I`ve made a ps1 script that terminates that process at system startup for you:
  • Create a file named "CloseTunnel.ps1" and paste here the following code
$processName = "tun2socks"

# Get the list of processes matching the name
$process = Get-Process -Name $processName -ErrorAction SilentlyContinue

if ($process) {
    # Terminate the process if it exists
    Stop-Process -Name $processName -Force
    Write-Host "Process '$processName' has been terminated."
} else {
    Write-Host "Process '$processName' is not running."
}
  • Press WIn+R and paste there "taskschd.msc" to open the Task Scheduler
  • Create a new task with any name you want
  • Set it to run with the highest privileges by a corresponding checkbox
  • Add a new trigger and set it to "At startup."
  • Add a new action and set the program/script to your path to PowerShell.exe (usually its C:\Windows\System32... etc.)
  • Add arguments -File "C:\path\to\CloseTunnel.ps1" and replace the path to your just created ps1 file
  • Now at startup you`ll see powershell opening and launching that script for a second and getting back you your internet and letting app to autostart correctly
Originally created by @Nodaysofff on GitHub (Nov 17, 2024). Original GitHub issue: https://github.com/amnezia-vpn/amnezia-client/issues/1258 **Describe the bug** App didnt close tunnel, when its quit anyting but its tray icon close button, which makes tunnel to persist after system restart and makes it unable to connect to the server again due to unterminated "tun2socks" process **To Reproduce** Steps to reproduce the behavior: 1. Just launch app as you usually do and use split tunneling 2. Click on 'Connect' and wait for app to establish connection to your server 3. Restart the system 4. See no internet when you`ve restarted, tun2socks and tunnel hanging, sometimes have app stuck on connecting, etc... **Expected behavior** App should handle scenario when its closed by the system, since now it closes tunnel only when user closes the app from the tray icon or from inside the app **Log files** I`ve described the bug, but in the logs it shows that tun2socks already running and quitting when you stuck at connecting **Desktop:** - OS: Windows 10 - Version any **Additional context** At the moment there is only two ways for you to escape such bug, until its fixed in the code: 1) Before the system shutdown (or anything that will terminate app process) you should close the app manually 2) I`ve made a ps1 script that terminates that process at system startup for you: - Create a file named "CloseTunnel.ps1" and paste here the following code ```# Define the name of the process to kill $processName = "tun2socks" # Get the list of processes matching the name $process = Get-Process -Name $processName -ErrorAction SilentlyContinue if ($process) { # Terminate the process if it exists Stop-Process -Name $processName -Force Write-Host "Process '$processName' has been terminated." } else { Write-Host "Process '$processName' is not running." } ``` - Press WIn+R and paste there "taskschd.msc" to open the Task Scheduler - Create a new task with any name you want - Set it to run with the highest privileges by a corresponding checkbox - Add a new trigger and set it to "At startup." - Add a new action and set the program/script to your path to PowerShell.exe (usually its C:\Windows\System32\... etc.) - Add arguments -File "C:\path\to\CloseTunnel.ps1" and replace the path to your just created ps1 file - Now at startup you`ll see powershell opening and launching that script for a second and getting back you your internet and letting app to autostart correctly
Author
Owner

@Ehsan-U commented on GitHub (Nov 20, 2024):

Stuck at connecting..
OS: Ubuntu 22

<!-- gh-comment-id:2487263493 --> @Ehsan-U commented on GitHub (Nov 20, 2024): Stuck at connecting.. OS: Ubuntu 22
Author
Owner

@TheGP commented on GitHub (Nov 20, 2024):

+1 windows 11

<!-- gh-comment-id:2488946459 --> @TheGP commented on GitHub (Nov 20, 2024): +1 windows 11
Author
Owner

@farhadsaberi commented on GitHub (Nov 23, 2024):

+1 Mac os

<!-- gh-comment-id:2495472772 --> @farhadsaberi commented on GitHub (Nov 23, 2024): +1 Mac os
Author
Owner

@Ehsan-U commented on GitHub (Nov 23, 2024):

Solved by reinstall

<!-- gh-comment-id:2495523495 --> @Ehsan-U commented on GitHub (Nov 23, 2024): Solved by reinstall
Author
Owner

@TheGP commented on GitHub (Nov 23, 2024):

@Ehsan-U the same, but not with a normal uninstal, but with Revo uninstaller (some additional registry cleaning)

<!-- gh-comment-id:2495548865 --> @TheGP commented on GitHub (Nov 23, 2024): @Ehsan-U the same, but not with a normal uninstal, but with Revo uninstaller (some additional registry cleaning)
Author
Owner

@wp-control commented on GitHub (Dec 2, 2024):

Solved by reinstall

How did you uninstall it in Ubuntu? I can't fully remove it =(

<!-- gh-comment-id:2512766719 --> @wp-control commented on GitHub (Dec 2, 2024): > Solved by reinstall How did you uninstall it in Ubuntu? I can't fully remove it =(
Author
Owner

@lunardunno commented on GitHub (Dec 24, 2024):

How did you uninstall it in Ubuntu? I can't fully remove it =(

To remove, run /opt/AmneziaVPN/maintenancetool

<!-- gh-comment-id:2560692228 --> @lunardunno commented on GitHub (Dec 24, 2024): > How did you uninstall it in Ubuntu? I can't fully remove it =( To remove, run /opt/AmneziaVPN/maintenancetool
Author
Owner

@TheGP commented on GitHub (Jan 13, 2025):

Why issue is closed? For me on Ubuntu it was not only XRay but all protocols, WG & over SS too

<!-- gh-comment-id:2586686859 --> @TheGP commented on GitHub (Jan 13, 2025): Why issue is closed? For me on Ubuntu it was not only XRay but all protocols, WG & over SS too
Author
Owner

@Ultraz46 commented on GitHub (Feb 1, 2025):

The problem is still relevant!

<!-- gh-comment-id:2629136467 --> @Ultraz46 commented on GitHub (Feb 1, 2025): The problem is still relevant!
Author
Owner

@iamshouvikmitra commented on GitHub (Feb 18, 2025):

None of the protocols work other than XRay

<!-- gh-comment-id:2664857427 --> @iamshouvikmitra commented on GitHub (Feb 18, 2025): None of the protocols work other than XRay
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
amnezia-vpn/amnezia-client#486
No description provided.