2016-08-18 3 views
0

Heroku에서 Python 앱을 실행하는 데 문제가 있습니다. 내 응용 프로그램은 날씨 데이터에 대한 웹 사이트를 긁어 내고 몇 가지 계산을 수행합니다. 데이터를 가져 오는 데 몇 초가 걸리지 않습니다. 내 앱을 열면 로그에 내 앱의 출력이 표시되지만 R10 오류가 발생할 때까지 내 앱 페이지가 계속로드되고 앱 페이지가 다운됩니다. 커맨드 라인에서 일회용 dyno를 사용하여 앱을 실행할 수 있습니다. 여기 내 로그는 다음과 같습니다Python 앱에서 Heroku R10 오류가 발생했습니다.

2016-08-18T13:58:34.073915+00:00 heroku[web.1]: Starting process with command `python WebScraper.py` 
    2016-08-18T13:58:40.982330+00:00 app[web.1]: http://170.94.200.136/weather/Inversion.aspx 
    2016-08-18T13:58:41.005187+00:00 app[web.1]:   Station Low Temp (F) Time of Low Current Temp (F) Current Time \ 
    2016-08-18T13:58:41.005202+00:00 app[web.1]: 0    0.0   0   74.3  8:49 AM 
    2016-08-18T13:58:41.005205+00:00 app[web.1]: Arkansas: no inversion and spray OK 
    2016-08-18T13:59:34.319236+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch 
    2016-08-18T13:59:34.319458+00:00 heroku[web.1]: Stopping process with SIGKILL 
    2016-08-18T13:59:34.443283+00:00 heroku[web.1]: Process exited with status 137 
    2016-08-18T13:59:34.459932+00:00 heroku[web.1]: State changed from starting to crashed 
    2016-08-18T13:59:34.460745+00:00 heroku[web.1]: State changed from crashed to starting 
    2016-08-18T13:59:39.598773+00:00 heroku[web.1]: Starting process with command `python WebScraper.py` 
    2016-08-18T13:59:46.087192+00:00 app[web.1]: http://170.94.200.136/weather/Inversion.aspx 
    2016-08-18T13:59:46.099928+00:00 app[web.1]:   Station Low Temp (F) Time of Low Current Temp (F) Current Time \ 
    2016-08-18T13:59:46.100543+00:00 app[web.1]: Ashley: strong inversion and no spray suggested 
    2016-08-18T14:00:07.473438+00:00 heroku[router]: at=error code=H20 desc="App boot timeout" method=GET path="/" host=temperature-inversion.herokuapp.com request_id=c477a7b2-d755-475a-ad11-f857764386b6 fwd="199.133.80.68" dyno= connect= service= status=503 bytes= 
    2016-08-18T14:00:39.933670+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch 
    2016-08-18T14:00:39.933712+00:00 heroku[web.1]: Stopping process with SIGKILL 
    2016-08-18T14:00:40.095100+00:00 heroku[web.1]: State changed from starting to crashed 
    2016-08-18T14:00:40.079022+00:00 heroku[web.1]: Process exited with status 137 
    2016-08-18T14:00:42.882673+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=temperature-inversion.herokuapp.com request_id=c5ee4daf-9825-4c53-8f9c-852b9a3eaae2 fwd="199.133.80.68" dyno= connect= service= status=503 bytes= 
    2016-08-18T14:00:44.549938+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=temperature-inversion.herokuapp.com request_id=f45183be-4b77-429e-91be-dfcf832ec3ca fwd="199.133.80.68" dyno= connect= service= status=503 bytes= 

답변

0

에게 Heroku는 web 과정을 60 초 이내에 $PORT에 결합 할 예정이다. Procfile에서 다른 종류의 프로세스 (예 : bot)를 사용해야하고 다른 프로세스를 조정해야합니다 (Python Twitter Bot w/ Heroku Error: R10 Boot Timeout과 유사).

+0

이렇게하면 H14 오류가 발생합니다. –

+0

아, 맞아 ... 그게 말이 되네. Heroku는 웹 응용 프로그램을 호스팅하기위한 것이므로 적어도 하나의 웹 dyno가 $ PORT에 바인딩 될 것으로 예상합니다. 옵션은 1) 스케줄러 애드온을 통해 스크립트를 실행 해보십시오. 2) 포트 요구 사항을 충족시키기 위해 플라스크와 같은 가벼운 프레임 워크를 사용하여 간단한 "do nothing"스크립트를 작성하십시오. – bimsapi

관련 문제