Heroku R10启动超时错误[英] Heroku R10 Boot Timeout Error

本文是小编为大家收集整理的关于Heroku R10启动超时错误的处理/解决方法,可以参考本文帮助大家快速定位并解决问题,中文翻译不准确的可切换到English标签页查看源文。

问题描述

我已经在Python中使用瓶子框架制造的Heroku上部署了一个小型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))

有什么想法吗?

推荐答案

您在127.0.0.1上听,而不是在公共IP上听.在您的run()>.

的呼叫中使用host='0.0.0.0'

本文地址:https://www.itbaoku.cn/post/765397.html

问题描述

I have deployed a small web app on Heroku made using Bottle framework in Python. I have no clue why I am getting the boot timeout here -

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=

This is 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))

Any idea?

推荐答案

You are listening on 127.0.0.1, instead of on your public IP. Use host='0.0.0.0' in your call to run().