python - Python - Heroku 部署错误启动超时
问题描述
我在 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
要求.txt
pandas==1.0.3 streamlit==0.61.0 datetime beautifulsoup4==4.9.1 requests==2.23.0
安装程序.sh
mkdir -p ~/.streamlit/ echo "\ [server]\n\ headless = true\n\ port = $PORT\n\ enableCORS = false\n\ \n\ " > ~/.streamlit/config.toml
我曾尝试删除该应用程序并将其推回 heroku 几次,但没有运气,也没有运气重新启动 dynos。有人看到我推送的文件有什么问题吗?谢谢。
解决方案
网络测功机必须$PORT
在启动后 60 秒内绑定到其分配。如果没有,则由测功机管理器终止,并记录R10 引导超时错误。
您需要在 procfile中传递$PORT
to :streamlit
web: sh setup.sh && streamlit run --server.port $PORT app.py
这里的文档可能会有所帮助:https ://devcenter.heroku.com/articles/dynos#web-dynos
推荐阅读
- python - 当我尝试计算奇数时,为什么有“无”?
- python - Sqlachemy 的问题。看不懂区别
- nginx - 如何查看一个 pod 是否超过了它的 CPU 限制?
- python - 不知道为什么:AttributeError: 'list' object has no attribute 'groupby'
- wordpress - 更新 wordpress 插件时如何使用 sftp 而不是 ftp?
- java - Redis - 考虑重命名 bean 之一或通过设置 spring.main.allow-bean-definition-overriding=true 来启用覆盖
- excel - 获取下一个文件时,excel VBA中的过程调用或参数无效
- php - 如何在php(laravel)中将坐标转换为经纬度?
- highcharts - Highstock 图表:导航器以负色显示错误区域
- php - 重写 htaccess 规则不完美