问题
I created a streamlit app in python and I'm trying to deploy it to Heroku following several youtube videos. However, I keep receiving the following errors and I'm not sure how to correct them.
2020-06-20T14:53:35.863016+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2020-06-20T14:53:35.885669+00:00 heroku[web.1]: Stopping process with SIGKILL
2020-06-20T14:53:35.970864+00:00 heroku[web.1]: Process exited with status 137
2020-06-20T14:53:36.011903+00:00 heroku[web.1]: State changed from starting to crashed
2020-06-20T14:53:36.749597+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=stockinfo-sl.herokuapp.com request_id=9ef454ce-0c45-423b-84ed-c6aa8fbd5a8f fwd="73.181.67.146" dyno= connect= service= status=503 bytes= protocol=https
Here are the following files I have pushed to heroku.
app.py (streamlit app which works on my local machine)
Proc file
web: sh setup.sh && streamlit run app.py
requirements.txt
pandas==1.0.3 streamlit==0.61.0 datetime beautifulsoup4==4.9.1 requests==2.23.0
setup.sh
mkdir -p ~/.streamlit/ echo "\ [server]\n\ headless = true\n\ port = $PORT\n\ enableCORS = false\n\ \n\ " > ~/.streamlit/config.toml
I have tried deleting the app and pushing it back onto heroku several times with no luck, also restarting the dynos with no luck. Does anybody see anything wrong with the files I have pushed? Thanks.
回答1:
A web dyno must bind to its assigned $PORT
within 60 seconds of startup. If it doesn’t, it is terminated by the dyno manager and a R10 Boot Timeout error is logged.
You need to pass the $PORT
to streamlit
in your procfile:
web: sh setup.sh && streamlit run --server.port $PORT app.py
Here's documentation that may help: https://devcenter.heroku.com/articles/dynos#web-dynos
来源:https://stackoverflow.com/questions/62487733/python-heroku-deployment-error-boot-timeout