Heroku部署错误H10 python烧瓶状态从最高更改为崩溃的烧瓶

时间:2020-04-26 21:57:48

标签: python flask heroku deployment

将烧瓶应用程序部署到heroku时,出现以下错误:

2020-04-26T21:08:41.625044+00:00 heroku[web.1]: State changed from crashed to starting
2020-04-26T21:09:01.332764+00:00 app[web.1]: [2020-04-26 21:09:01 +0000] [4] [INFO] Starting gunicorn 19.9.0
2020-04-26T21:09:01.333257+00:00 app[web.1]: [2020-04-26 21:09:01 +0000] [4] [INFO] Listening at: http://0.0.0.0:33049 (4)
2020-04-26T21:09:01.333352+00:00 app[web.1]: [2020-04-26 21:09:01 +0000] [4] [INFO] Using worker: sync
2020-04-26T21:09:01.336969+00:00 app[web.1]: [2020-04-26 21:09:01 +0000] [10] [INFO] Booting worker with pid: 10
2020-04-26T21:09:01.410439+00:00 app[web.1]: [2020-04-26 21:09:01 +0000] [18] [INFO] Booting worker with pid: 18
2020-04-26T21:09:01.848237+00:00 heroku[web.1]: State changed from starting to up
2020-04-26T21:09:11.801850+00:00 app[web.1]: Trying to connect...
2020-04-26T21:09:11.802586+00:00 app[web.1]: Trying to connect...
2020-04-26T21:09:11.930395+00:00 app[web.1]: Connection to DB successful!
2020-04-26T21:09:11.932232+00:00 app[web.1]: Connection to DB successful!
2020-04-26T21:09:18.252384+00:00 heroku[web.1]: State changed from up to crashed
2020-04-26T21:19:42.631900+00:00 heroku[web.1]: State changed from crashed to starting
2020-04-26T21:20:05.672114+00:00 heroku[web.1]: State changed from starting to up
2020-04-26T21:20:05.494694+00:00 app[web.1]: [2020-04-26 21:20:05 +0000] [4] [INFO] Starting gunicorn 19.9.0
2020-04-26T21:20:05.495198+00:00 app[web.1]: [2020-04-26 21:20:05 +0000] [4] [INFO] Listening at: http://0.0.0.0:37061 (4)
2020-04-26T21:20:05.495301+00:00 app[web.1]: [2020-04-26 21:20:05 +0000] [4] [INFO] Using worker: sync
2020-04-26T21:20:05.499328+00:00 app[web.1]: [2020-04-26 21:20:05 +0000] [10] [INFO] Booting worker with pid: 10
2020-04-26T21:20:05.561055+00:00 app[web.1]: [2020-04-26 21:20:05 +0000] [18] [INFO] Booting worker with pid: 18
2020-04-26T21:20:16.910330+00:00 app[web.1]: Trying to connect...
2020-04-26T21:20:16.915140+00:00 app[web.1]: Trying to connect...
2020-04-26T21:20:17.063353+00:00 app[web.1]: Connection to DB successful!
2020-04-26T21:20:17.064587+00:00 app[web.1]: Connection to DB successful!
2020-04-26T21:20:23.972510+00:00 heroku[web.1]: State changed from up to crashed
2020-04-26T21:21:01.298757+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=app-7square.herokuapp.com request_id=ebe102f1-467d-4251-9801-b5db3bb471b1 fwd="96.23.163.37" dyno= connect= service= status=503 bytes= protocol=https
2020-04-26T21:21:01.561501+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=app-7square.herokuapp.com request_id=12b59677-1634-4bf9-9b56-dc150ca8aafb fwd="96.23.163.37" dyno= connect= service= status=503 bytes= protocol=https

我的Procfile如下所示:

web: gunicorn app:app

我的app.py

app = Flask(__name__, template_folder='templates')
if __name__ == '__main__':
        #app.secret_key = 'super secret key'
        app.run()

我尝试了Heroku restart,将Procfile更改为web: gunicorn --bind 0.0.0.0:$PORT app:server --timeout 90 --log-file -,但这没用。

我要连接的数据库是一个AWS RDS实例,而gunicorn在requirements.txt文件中

请让我知道是否有更多信息可以帮助您,非常感谢!

0 个答案:

没有答案
相关问题