ngrok icon indicating copy to clipboard operation
ngrok copied to clipboard

Tunnel session failed: The tunnel https://mytunnel.ngrok.io is already bound to another tunnel session

Open jimunoz1990 opened this issue 8 years ago • 4 comments

Trying to create a http tunnel and getting this error message.

The tunnels are not online in the web dashboard, I've killed all my processes, restarted, and waited for awhile.

Issue has been occurring for a few months, I just renamed the tunnels to continue working in the meantime, but the problem still persists when I try to bring them back up.

jimunoz1990 avatar Feb 09 '17 15:02 jimunoz1990

same issue here

hugodes avatar Feb 28 '18 17:02 hugodes

Same issue here as well

aszalacinski avatar Apr 23 '19 22:04 aszalacinski

same issue here. Also it looks like there is something listening on that tunnel when I did get http://mytunnel.ngrok.io I got "couldn't GET /" as a response

KonradCichocki7 avatar Apr 30 '19 05:04 KonradCichocki7

Same issue

mattAktify avatar Oct 01 '21 17:10 mattAktify

Oh my, this is getting complicated.

I use ngrok in CI. After my env was destroyed, and I tried to spawn new one with same URL and I got :

ERROR: failed to start tunnel: The tunnel ... is already bound to another tunnel session

OK, so I need a way to close tunnel, right? Like ngrok close . But there is no such command from CLI :/ This feature request was closed: https://github.com/inconshreveable/ngrok/issues/167

Meaning what I'm left with is to implement API request https://ngrok.com/docs/api/resources/tunnel-sessions/#request-3 - which is not what I want to do, because at this point system gets overy complicated :/

So at this point I'm like - dude, you miss basic functionality there :/

gladykov avatar Apr 24 '24 14:04 gladykov

For future generations of lost wanderers coming here from Google:

In my case it was happening, because I did not close properly tunnel opened by ngrok http and connection have been hanging (because it has timeout, to be able to auto resume in case of temporary connectivity loss). I was opening tunnels in background, and not properly destroying them manually.

Properly killing, means pressing Ctrl + C to send SIGINT signal. This way local agent will send close connection request to remote tunnel.

To solve this issue, I send SIGINT to ngrok processes:

pgrep ngrok | while read -r pid ; do
    echo "Killing ngrok tunnel with PID $pid"
    kill -INT $pid
done

sleep 3

gladykov avatar May 03 '24 00:05 gladykov

Thank you for opening this issue! As of April 2016, the ngrok service has permanently moved to https://ngrok.com/. To join the community and file bug reports or feature enhancements for the ngrok agent, please go to https://github.com/ngrok/ngrok.

This repository is no longer actively maintained and will be archived soon to reduce confusion with the latest ngrok versions. We thank you for the continued support of ngrok and look forward to seeing you over at ngrok.com and the ngrok Community Repo.

russorat avatar May 08 '24 18:05 russorat