При развертывании моего приложения flask на 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
my Procfile
выглядит следующим образом:
web: gunicorn app:app
my 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 находится в файле require.txt
Пожалуйста, дайте мне знать, если есть какая-то дополнительная информация, которую я могу предоставить, чтобы помочь вам, спасибо, большое!