【问题标题】:Heroku R10 Boot Timeout ErrorHeroku R10 启动超时错误
【发布时间】:2014-01-13 13:26:36
【问题描述】:

我在 Heroku 上部署了一个使用 Python 中的 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))

有什么想法吗?

【问题讨论】:

    标签: python web-applications heroku flask bottle


    【解决方案1】:

    您正在收听 127.0.0.1,而不是您的公共 IP。在对run() 的调用中使用host='0.0.0.0'

    【讨论】:

      猜你喜欢
      • 2012-05-15
      • 2014-03-24
      • 2021-11-29
      • 1970-01-01
      • 2015-08-15
      • 2019-06-01
      • 2017-02-15
      • 2018-10-13
      • 2020-05-20
      相关资源
      最近更新 更多