pjaol
pjaol

Reputation: 242

ERR_NGROK_108 using pyngrok

Really running out of steam trying to figure this puppy out

I've tried every version documented and simply can't get this to work I've gone back and forth between pyngrok and ngrok

def start_ngrok() : 
   from pyngrok.conf import PyngrokConfig
   from pyngrok import ngrok, conf


   conf.get_default().config_path = "settings/ngrok.yml"
   tunnel = ngrok.connect(name="app")
    
   #tunnel = ngrok.connect(addr="127.0.0.1:3000", proto="http", bind_tls=True)
   url = tunnel.public_url

my settings/ngrok.yml contains

region: us
version: '2'
authtoken: XXXXXX
api_key: XXXXXX
tunnels:
  app:
    addr: https://127.0.0.1:3000
    proto: http
    #bind_tls: true

I keep getting the following error ERR_NGROK_108

2023-08-23 15:57:40,310 - pyngrok.ngrok - INFO - Opening tunnel named: app
2023-08-23 15:57:40,310 - pyngrok.process - INFO - Starting ngrok with config file: settings/ngrok.yml
2023-08-23 15:57:40,313 - pyngrok.process - DEBUG - ngrok process starting with PID: 97578
2023-08-23 15:57:40,322 - pyngrok.process.ngrok - INFO - t=2023-08-23T15:57:40-0400 lvl=info msg="open config file" path=/Users/patrick/Projects/[XXXX]/settings/ngrok.yml err=nil
2023-08-23 15:57:40,323 - pyngrok.process.ngrok - WARNING - t=2023-08-23T15:57:40-0400 lvl=warn msg="can't bind default web address, trying alternatives" obj=web addr=127.0.0.1:4040
2023-08-23 15:57:40,323 - pyngrok.process.ngrok - INFO - t=2023-08-23T15:57:40-0400 lvl=info msg="starting web service" obj=web addr=127.0.0.1:4041 allow_hosts=[]

ERROR:  authentication failed: Your account is limited to 1 simultaneous ngrok agent session.
ERROR:  You can run multiple tunnels on a single agent session using a configuration file.
ERROR:  To learn more, see https://ngrok.com/docs/secure-tunnels/ngrok-agent/reference/config/
ERROR:  
ERROR:  Active ngrok agent sessions in region 'us':
ERROR:    - [XXXXX] ([XXXXX])
ERROR:  
ERROR:  ERR_NGROK_108
ERROR:  
2023-08-23 15:57:40,434 - pyngrok.process.ngrok - ERROR - t=2023-08-23T15:57:40-0400 lvl=eror msg="failed to reconnect session" obj=tunnels.session obj=csess id=[XXXX] err="authentication failed: Your account is limited to 1 simultaneous ngrok agent session.\nYou can run multiple tunnels on a single agent session using a configuration file.\nTo learn more, see https://ngrok.com/docs/secure-tunnels/ngrok-agent/reference/config/\n\nActive ngrok agent sessions in region 'us':\n  - [XXXXXX]
 ([XXXXX])\r\n\r\nERR_NGROK_108\r\n"

Checking the client api

$ ngrok --config settings/ngrok.yml api tunnel-sessions list
200 OK
{
  "next_page_uri": null,
  "tunnel_sessions": [],
  "uri": "https://api.ngrok.com/tunnel_sessions"
}

I've checked the ngrok dashboard no agents are running, no tunnels exist I can call the CLI just fine

16:18 $ which ngrok
/............/env/bin/ngrok

16:17 $ ngrok --config settings/ngrok.yml start app

Works fine, it's just using the while using connect it bombs out And I've run out of ideas

I've used all the connect methods listed in the pydocs

Upvotes: 0

Views: 518

Answers (0)

Related Questions