2017-05-25 104 views
0

我正在使用烧瓶和python(2.7)。我构建了一个在localhost上运行没有问题的应用程序,但现在它不能在heroku上运行。Heroku错误代码H10n无法运行应用程序

,即时通讯越来越当我运行Heroku的日志 - 尾是错误: 与运行的Heroku重启:

17-05-25T17:22:27.879428+00:00 heroku[web.1]: Starting process with command `python project.py` 
    2017-05-25T17:22:32.083014+00:00 app[web.1]: * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit) 
    2017-05-25T17:22:32.086435+00:00 app[web.1]: * Restarting with stat 
    2017-05-25T17:22:32.410829+00:00 app[web.1]: * Debugger is active! 
    2017-05-25T17:22:32.425538+00:00 app[web.1]: * Debugger PIN: 308-659-015 
    2017-05-25T17:23:23.016962+00:00 heroku[web.1]: Restarting 
    2017-05-25T17:23:23.879234+00:00 heroku[web.1]: Stopping all processes with SIGTERM 
    2017-05-25T17:23:24.135864+00:00 heroku[web.1]: Process exited with status 0 
    2017-05-25T17:23:26.983758+00:00 heroku[web.1]: Starting process with command `python project.py` 
    2017-05-25T17:23:31.588440+00:00 app[web.1]: * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit) 
    2017-05-25T17:23:31.591852+00:00 app[web.1]: * Restarting with stat 
    2017-05-25T17:23:32.223153+00:00 app[web.1]: * Debugger is active! 
    2017-05-25T17:23:32.247252+00:00 app[web.1]: * Debugger PIN: 211-683-280 
    2017-05-25T17:23:57.249472+00:00 heroku[router]: at=error code=H20 desc="App boot timeout" method=GET path="/" host=park-picker.herokuapp.com request_id=061f52b3-38e4-4126-b6e3-90129eff15a8 fwd="73.240.112.202" dyno= connect= service= status=503 bytes= protocol=https 
2017-05-25T17:22:27.879428+00:00 heroku[web.1]: Starting process with command `python project.py` 
2017-05-25T17:22:32.083014+00:00 app[web.1]: * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit) 
2017-05-25T17:22:32.086435+00:00 app[web.1]: * Restarting with stat 
2017-05-25T17:22:32.410829+00:00 app[web.1]: * Debugger is active! 
2017-05-25T17:22:32.425538+00:00 app[web.1]: * Debugger PIN: 308-659-015 
2017-05-25T17:23:23.016962+00:00 heroku[web.1]: Restarting 
2017-05-25T17:23:23.879234+00:00 heroku[web.1]: Stopping all processes with SIGTERM 
2017-05-25T17:23:24.135864+00:00 heroku[web.1]: Process exited with status 0 
2017-05-25T17:23:26.983758+00:00 heroku[web.1]: Starting process with command `python project.py` 
2017-05-25T17:23:31.588440+00:00 app[web.1]: * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit) 
2017-05-25T17:23:31.591852+00:00 app[web.1]: * Restarting with stat 
2017-05-25T17:23:32.223153+00:00 app[web.1]: * Debugger is active! 
2017-05-25T17:23:32.247252+00:00 app[web.1]: * Debugger PIN: 211-683-280 
2017-05-25T17:23:57.249472+00:00 heroku[router]: at=error code=H20 desc="App boot timeout" method=GET path="/" host=park-picker.herokuapp.com request_id=061f52b3-38e4-4126-b6e3-90129eff15a8 fwd="73.240.112.202" dyno= connect= service= status=503 bytes= protocol=https 
2017-05-25T17:24:27.034926+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch 
2017-05-25T17:24:27.034926+00:00 heroku[web.1]: Stopping process with SIGKILL 
2017-05-25T17:24:27.206980+00:00 heroku[web.1]: State changed from starting to crashed 
2017-05-25T17:24:27.186502+00:00 heroku[web.1]: Process exited with status 137 
2017-05-25T17:24:28.221792+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=park-picker.herokuapp.com request_id=cac9dc85-6e54-4bbe-b0a1-91f0a4fd5531 fwd="73.240.112.202" dyno= connect= service= status=503 bytes= protocol=https 
2017-05-25T17:24:29.063671+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=park-picker.herokuapp.com request_id=04215139-8e22-4d61-9e28-8fddab312da4 fwd="73.240.112.202" dyno= connect= service= status=503 bytes= protocol=https 
2017-05-25T17:24:29.750162+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=park-picker.herokuapp.com request_id=6db46984-3a90-4dc8-af96-b0bbf97e1f4c fwd="73.240.112.202" dyno= connect= service= status=503 bytes= protocol=https 

我已经试过最一切我能找到,我甚至改变了我的app.run()清空而不是app.run(host='0.0.0.0', port=int(os.environ.get('PORT', 33507)))试图允许heroku自己定义(我相信这导致了H20错误,这已被改回)。

我proc文件是:

web: python project.py 

,被 pip freeze > requirements.txt

该项目使用VM始建产生我requirements.txt,所以我甚至试图消除Vagrantfile,没有效果。

任何帮助非常感谢,我感到茫然,谢谢!

回答

1

project.py我错过了import os声明

解决的问题。

相关问题