【发布时间】:2020-10-10 17:44:06
【问题描述】:
我在 python 中创建了一个流式应用程序,并尝试在几个 youtube 视频之后将其部署到 Heroku。但是,我不断收到以下错误,不知道如何更正。
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
这是我推送到heroku的以下文件。
-
app.py(在我的本地机器上运行的流式应用)
-
过程文件
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
我已经尝试删除应用程序并将其推回 heroku 几次,但没有运气,也没有运气重新启动 dynos。有人看到我推送的文件有什么问题吗?谢谢。
【问题讨论】:
-
第一条错误信息可能很关键——你的 web 进程必须绑定到一个外部可见的端口。例如,如果您使用 Flask,则需要在
run()参数中使用host='0.0.0.0'。见stackoverflow.com/questions/36683571/…