Flask Google Cloud App Engine: Oserror: [errno 98] Address Already In Use
I am trying to deploy a flask app on google cloud app engine. It runs smooth in my virtual environment locally but I get an 502 error running it in the cloud. Now I am trying to d
Solution 1:
I had a similar problem, it was caused by the Flask app also being run when the module was loaded, because I had
if __name__ == "__main__":
app.run()
at the bottom. Note that the recent requirement to name your sever file "main.py" could cause this bug to emerge.
Solution 2:
I think the problem is that you don't need to specialize the port for cloud. Google Cloud finds the port to run your app on its own. So instead of app.run(port=8080)
just write app.run()
Solution 3:
While I was not able to figure out how to "free" the running address, I solved the problem by starting another flask process by running it on a different port like so:
flask run --port=80
Post a Comment for "Flask Google Cloud App Engine: Oserror: [errno 98] Address Already In Use"