【发布时间】:2014-03-24 17:51:00
【问题描述】:
我以http://flask.pocoo.org/docs/quickstart/为例,“工头启动”后我可以在自己的机器上运行它,但是当我在heroku上部署它时,出现R10超时错误。
我写了 Procfileas:
web: python flaskr.py
为了运行“git push heroku master”命令,我删除了“disreibute==0.6.24”语句,因为如果没有,我会得到如下错误:
Traceback (most recent call last):
File "<string>", line 1, in <module>
NameError: name 'install' is not defined
所以我不知道是Procfile还是requirements.txt文件错误还是其他错误。我几乎阅读了我找到的所有文章,但问题还没有解决。
另外,例子中使用了SQLite3数据库,不知道是不是跟这个有关..
最后,我会在这里列出日志:
at=error code=H20 desc="App boot timeout" method=GET path=/ host=tranquil-tor-4127.herokuapp.com request_id=8a088587-bee9-40e9-a686-0555843c191b fwd="8.35.201.53" dyno= connect= service= status=503 bytes=
Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
Stopping process with SIGKILL
Process exited with status 137
at=error code=H10 desc="App crashed" method=GET path=/ host=tranquil-tor-4127.herokuapp.com request_id=59ccb901-e988-430d-93e8-f83a8930e60b fwd="8.35.201.50" dyno= connect= service= status=503 bytes=
at=error code=H10 desc="App crashed" method=GET path=/ host=tranquil-tor-4127.herokuapp.com request_id=7b76850f-7c25-481f-8216-542d9baaa769 fwd="8.35.201.51" dyno= connect= service= status=503 bytes=
Slug compilation started
State changed from crashed to starting
at=error code=H10 desc="App crashed" method=GET path=/ host=tranquil-tor-4127.herokuapp.com request_id=5601bbce-b00c-4927-8d9c-ac534745859d fwd="8.35.201.52" dyno= connect= service= status=503 bytes=
我注意到slug编译可以正常完成,然后出现R10错误。
【问题讨论】:
-
上述文章没有提到 Heroku。它们是在本地部署应用程序和在 Heroku 上部署应用程序时的一些差异。 Heroku 需要虚拟环境来部署应用程序。请参考devcenter.heroku.com/articles/getting-started-with-python 在 Heroku 上部署您的应用
-
heroku 不支持 sqlite3。