Can someone explain to me this error message on Heroku? App works fine locally but has never succeeded online
heroku[slug-compiler]: Slug compilation started
heroku[slug-compiler]: Slug compilation finished
heroku[web.1]: State changed from crashed to starting
heroku[web.1]: Starting process with command `python app.py ${PORT}`
app[web.1]: * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
The app itself is not very complicated
from flask import Flask, render_template
app = Flask(__name__, static_folder='static')
@app.route('/')
def hello_world():
return render_template('index.html')
if __name__ == '__main__':
from os import environ
app.run(debug=False, port=environ.get("PORT", 5000))
You need to specify host='0.0.0.0'
in app.run()
. Unless told otherwise, Flask binds to "localhost", which means it won't bind to an externally visible interface.
See Flask - configure dev server to be visible across the network
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With