gstaff / flask-ngrok

A simple way to demo Flask apps from your machine.
Other
138 stars 58 forks source link

IndexError: list index out of range returned, even with flask==0.12.2 #11

Open Santosh-Gupta opened 4 years ago

Santosh-Gupta commented 4 years ago

In colab, This was a problem in Flask 1.0.0 , so we needed to install 0.12.2, but today the same error is occuring

2020-04-01 20:25:38.382669: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudart.so.10.1
 * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.6/threading.py", line 1182, in run
    self.function(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.6/dist-packages/flask_ngrok.py", line 70, in start_ngrok
    ngrok_address = _run_ngrok()
  File "/usr/local/lib/python3.6/dist-packages/flask_ngrok.py", line 38, in _run_ngrok
    tunnel_url = j['tunnels'][0]['public_url']  # Do the parsing of the get
IndexError: list index out of range
snehsagarajput commented 3 years ago

I was having the same issue. Restarting the Runtime automatically solved the error for me.

thanujan96 commented 1 year ago

I believe that the small delay is causing this error, because the program is unable to retrieve the public URL in the subsequent lines of code. try to increase time.sleep in _run_ngrok().