简体   繁体   中英

Deploying Dash app to Heroku: error code=H10, H13

This is my first time deploying an app to Heroku. I built a Dash app in Python that works fine in localhost and I was able to successfully build and deploy it on Heroku following tutorials for Dash though the application doesn't load when I try to launch it (instead it produces errors in logs).

I am using a Windows machine and also had to add and use this custom build pack ([located here][1]) to use Git LFS as one of my data files is too large to fit on the Git repository.

I have created a Procfile:

web: gunicorn app:server

and installed/added gunicorn to requirements.txt

I'm getting these application errors when I try to launch the app after the build is successfully completed.

2020-05-27T03:43:30.000000+00:00 app[api]: Build succeeded
2020-05-27T03:50:00.231102+00:00 heroku[web.1]: State changed from crashed to starting
2020-05-27T03:50:30.788014+00:00 heroku[web.1]: Starting process with command `gunicorn app:server`
2020-05-27T03:50:34.709044+00:00 app[web.1]: [2020-05-27 03:50:34 +0000] [4] [INFO] Starting gunicorn 20.0.4
2020-05-27T03:50:34.710044+00:00 app[web.1]: [2020-05-27 03:50:34 +0000] [4] [INFO] Listening at: http://0.0.0.0:37455 (4)
2020-05-27T03:50:34.710172+00:00 app[web.1]: [2020-05-27 03:50:34 +0000] [4] [INFO] Using worker: sync
2020-05-27T03:50:34.715383+00:00 app[web.1]: [2020-05-27 03:50:34 +0000] [10] [INFO] Booting worker with pid: 10
2020-05-27T03:50:34.720666+00:00 app[web.1]: [2020-05-27 03:50:34 +0000] [11] [INFO] Booting worker with pid: 11
2020-05-27T03:50:35.355566+00:00 heroku[web.1]: State changed from starting to up
2020-05-27T03:50:56.465384+00:00 heroku[web.1]: Process running mem=1280M(250.0%)
2020-05-27T03:50:56.493628+00:00 heroku[web.1]: Error R15 (Memory quota vastly exceeded)
2020-05-27T03:50:56.496502+00:00 heroku[web.1]: Stopping process with SIGKILL
2020-05-27T03:50:56.653528+00:00 heroku[web.1]: Process exited with status 137
2020-05-27T03:50:56.689016+00:00 heroku[web.1]: State changed from up to crashed
2020-05-27T03:50:56.575446+00:00 heroku[router]: at=error code=H13 desc="Connection closed without response" method=GET path="/" host=####.herokuapp.com request_id=56fd4ef7-74a1-4142-9637
-e76cb6a078f6 fwd="155.33.132.49" dyno=web.1 connect=0ms service=19725ms status=503 bytes=0 protocol=https
2020-05-27T03:51:01.934855+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=####.herokuapp.com request_id=1c984ec2-5f22-4620-b3c5-34957d287d0
f fwd="155.33.132.49" dyno=web.1 connect=5000ms service= status=503 bytes= protocol=https

I'm not able to make much sense of the output from the log so I'm quite stuck as to things to troubleshoot or try.

Some clarification on Heroku errors:

Error R15: the memory of your application exceeds 200% of allowed memory.
Error H13: a process in your dyno opens a connection but closes it before anything is written to it.
Error H10: app crashed and is shutting down.


So what's happening with your application?
It's clear that you're overloading the memory of your dyno, causing the connection to immediately close and the app to crash.

Solutions:

  • Consider scaling up your dynos (at least to debug and see if your app works with larger available memory).
  • Offload the data from your application, store it in a database and dynamically retrieve as needed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM