fieldOfView / OctoPrint-ngrok

An OctoPrint Plugin that provides remote access using ngrok
GNU Affero General Public License v3.0
15 stars 8 forks source link

Error "your account is limited to 1 simultaneous ngrok client sessions" on create tunnel #22

Open derekantrican opened 3 years ago

derekantrican commented 3 years ago

There seems to be some situations where restarting octoprint (or maybe other situations) does not kill/close the current ngrok session. If there is an error when trying to create a tunnel similar to "your account is limited to 1 simultaneous ngrok client sessions" then the plugin should kill the running ngrok process then try again.

fieldOfView commented 3 years ago

Unfortunately, this is hard to do. The plugin only has access to the tunnel that the plugin itself created. If a plugin is somehow "orphaned", it is no longer under the control of the plugin, so the plugin can not close it. I will look in to guiding the user to ways to close the tunnel via https://dashboard.ngrok.com

derekantrican commented 3 years ago

Last time I had this happen to me the ngrok dashboard didn't have an option to close the tunnel. I had to ssh into the pi and kill the process manually. What is preventing the plugin from killing an already-existing ngrok process?

fieldOfView commented 3 years ago

The plugin starts an ngrok process; an external application. That ngrok process spawns a tunnel (or multiple tunnels, if the ngrok account allows it and the plugin would request it). Normally when OctoPrint is shut down, the plugin instructs the ngrok process to shut down, closing the tunnel. If somehow the ngrok process is not shut down, the plugin will start a new ngrok process because it has no access to the old process.

If you have a sure-fire way to orphan a tunnel process, let me know.

fieldOfView commented 3 years ago

The functionality to close a tunnel process from the dashboard is in beta at ngrok.

derekantrican commented 3 years ago

Can you run terminal commands from the python extension? If so, I would just run killall ngrok which would kill any currently running ngrok process

thanhdatdev commented 1 year ago

ngrok http 3000 --region us

pacineee commented 1 year ago

This ngrok issue is getting me a headache... a moment I'm getting a solution...

aplahore4 commented 1 year ago

In windows I killed the process from task manager and run ngrok http 8000 It worker for me.

dannyboothman commented 4 months ago
  1. Login to ngrok dashboard
  2. Go to: Tunnels > Agents
  3. You'll then see a list of active agents, and on the right of each agent, 3 icons: Stop, Restart, and Update. Click Stop.
blarzHernandez commented 4 weeks ago

ngrok http 3000 --region us I did ngrok http 3000 --region eu This allowed me having more than 1 simultaneous client sessions