Heroku R10启动超时错误

时间:2013-12-25 18:11:38

标签: python web-applications heroku flask bottle

我在Heroku上部署了一个使用Bottle框架的小型Web应用程序。我不知道为什么我在这里得到启动超时 -

2013-12-25T17:53:23.098442+00:00 heroku[web.1]: Starting process with command `python myapp.py`
2013-12-25T17:53:25.230922+00:00 app[web.1]: Listening on http://127.0.0.1:31150/
2013-12-25T17:53:25.230695+00:00 app[web.1]: Bottle v0.11.6 server starting up (using GeventServer())...
2013-12-25T17:53:25.231052+00:00 app[web.1]: Hit Ctrl-C to quit.
2013-12-25T17:53:25.231052+00:00 app[web.1]: 
2013-12-25T17:54:13.434121+00:00 heroku[router]: at=error code=H20 desc="App boot timeout" method=GET path=/ host=shrouded-spire-2869.herokuapp.com fwd="49.14.226.100" dyno= connect= service= status=503 bytes=
2013-12-25T17:54:23.622928+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2013-12-25T17:54:23.623289+00:00 heroku[web.1]: Stopping process with SIGKILL
2013-12-25T17:54:24.890546+00:00 heroku[web.1]: Process exited with status 137
2013-12-25T17:54:24.901419+00:00 heroku[web.1]: State changed from starting to crashed
2013-12-25T17:54:26.867178+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/favicon.ico host=shrouded-spire-2869.herokuapp.com fwd="106.78.169.174" dyno= connect= service= status=503 bytes=
2013-12-25T17:53:36.038209+00:00 heroku[router]: at=error code=H20 desc="App boot timeout" method=GET path=/ host=shrouded-spire-2869.herokuapp.com fwd="49.14.226.100" dyno= connect= service= status=503 bytes=

这是myapp.py:

import gevent.monkey; gevent.monkey.patch_all()
import bottle
import requests
from pyquery import PyQuery as pq
import os

# Rest of the code here

run(server='gevent', port=os.environ.get('PORT', 5000))

有什么想法吗?

1 个答案:

答案 0 :(得分:4)

您正在聆听127.0.0.1,而不是公共IP。在致电host='0.0.0.0'时使用run()