6

I was running a "local" web app on Google Colab using flask-ngrok according to this article: Flask on Google Colab. It was working appropriately in the past but today I started to get the error: "Tunnel _______.ngrok.io not found" whenever I try to access the generated public URL by ngrok. Everything was unchanged since the last time when it still worked. I checked the flask-ngrok package, looks like the package version remains unchanged since 2018. Couldn't figure out what is going wrong. Any help would be appreciated!

!pip install flask-ngrok


from flask_ngrok import run_with_ngrok
from flask import Flask

app = Flask(__name__)
run_with_ngrok(app)   #starts ngrok when the app is run

@app.route("/")
def home():
    return "<h1>Running Flask on Google Colab!</h1>"

app.run()

Here's another similar article: Running Python Flask Apps on Google Colab, there is a link to the full code in colab where you can run it yourself. It now gives the same tunnel not found error too.

Spartan 332
  • 221
  • 1
  • 2
  • 4
  • 2
    Same problem here. No code was changed and it stopped working. It was fine for months. I suspect that perhaps Colab is closing these sessions. – jvence Jan 31 '21 at 06:56
  • 2
    Does this answer your question? [Tunnel not found error Pyngrok streamlit collab](https://stackoverflow.com/questions/65966425/tunnel-not-found-error-pyngrok-streamlit-collab) – alexdlaird Feb 02 '21 at 16:47

1 Answers1

1

There was an inadvertent block put in place by the ngrok engineering team for the Google Colab environment due to a new tweak to the abuse prevention system.

It's since been rolled back so you shouldn't see this ""Tunnel _______.ngrok.io not found" from within Google Colab anymore (hopefully).