Python - Heroku deployment error boot timeout

假装没事ソ 提交于 2021-01-29 20:55:50

问题


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.

  1. app.py (streamlit app which works on my local machine)

  2. Proc file

    web: sh setup.sh && streamlit run app.py
    
  3. requirements.txt

    pandas==1.0.3
    streamlit==0.61.0
    datetime
    beautifulsoup4==4.9.1
    requests==2.23.0
    
  4. 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!