【发布时间】:2016-06-23 05:20:40
【问题描述】:
所以我在玩弄 slack API 并最终制作了一个简单的 slack 机器人,无论网站是否启动(当提供 URL 时)都会在 slack 频道上发布信息
每当我将它部署到 heroku 时,它会在前 60 秒内工作,然后在日志中抛出类似这样的错误
2016-06-22T20:18:11.933928+00:00 heroku[web.1]: State changed from crashed to starting
2016-06-22T20:18:15.635404+00:00 heroku[web.1]: Starting process with command `python margo/margo.py 5000`
2016-06-22T20:18:18.724727+00:00 app[web.1]: StarterBot connected and running!
2016-06-22T20:19:15.714485+00:00 heroku[web.1]: Stopping process with SIGKILL
2016-06-22T20:19:15.714485+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2016-06-22T20:19:16.857081+00:00 heroku[web.1]: Process exited with status 137
2016-06-22T20:19:16.874584+00:00 heroku[web.1]: State changed from starting to crashed
我的Procfile 看起来像这样
web: python margo/margo.py 5000
我四处搜索,found this 和this 说PORT 应该在Profile 中指定,我像上面一样在Procfile 中更改了它。但我的只是一个简单的 python 脚本,而不是一个完整的 Flask/Django 应用程序。
各位有什么想法吗?
编辑
我读到$PORT 环境变量是由heroku 设置的。所以我的Procfile 现在是
web: python margo/margo.py $PORT
但程序在部署时再次崩溃并显示相同的错误消息
【问题讨论】:
标签: python heroku deployment