0
我在Heroku中運行我的Python應用程序時出現問題。我的應用程序爲天氣數據颳了一個網站,並對其進行了一些計算。提取數據不會超過幾秒鐘。當我打開我的應用程序時,我的日誌顯示我的應用程序的輸出,但我的應用程序頁面繼續加載,直到出現R10錯誤,然後應用程序頁面崩潰。我可以使用命令行中的一次性測試程序運行我的應用程序。這裏是我的日誌:Heroku R10 Python應用程序錯誤
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=
這樣做只會給我一個H14錯誤。 –
啊,對......這很有道理; Heroku旨在用於託管Web應用程序,因此它至少需要一個Web dyno綁定到$ PORT。您的選擇似乎是1)嘗試通過調度程序加載項來運行腳本2)使用像燒瓶這樣的輕量級框架來創建一個簡單的「無所事事」腳本以滿足端口要求。 – bimsapi