Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

flask-ngrok returns "Tunnel _________.ngrok.io not found" when running flask app via ngrok on Google Colab [duplicate]

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.

like image 736
Spartan 332 Avatar asked Jan 29 '21 19:01

Spartan 332


1 Answers

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).

like image 61
Andrew Benton Avatar answered Oct 25 '22 06:10

Andrew Benton