0
votes

Im trying all day to deploy this app (uses Flask and Plotly Dash). The deploying process works and the app runs locally without any problem but I always get an Application Error when I try to view the page and can't fix it

(mainly this one: at=error code=H10 desc="App crashed" method=GET path="/").

Here is the Traceback and the errors:

2019-10-20T18:48:07.34022+00:00 app[web.1]: Traceback (most recent call last): 2019-10-20T18:48:07.340229+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/gunicorn/arbiter.py", line 210, in run 2019-10-20T18:48:07.34048+00:00 app[web.1]: self.sleep() 2019-10-20T18:48:07.340483+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/gunicorn/arbiter.py", line 360, in sleep 2019-10-20T18:48:07.340674+00:00 app[web.1]: ready = select.select([self.PIPE[0]], [], [], 1.0) 2019-10-20T18:48:07.340678+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/gunicorn/arbiter.py", line 245, in handle_chld 2019-10-20T18:48:07.340823+00:00 app[web.1]: self.reap_workers() 2019-10-20T18:48:07.340827+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/gunicorn/arbiter.py", line 528, in reap_workers 2019-10-20T18:48:07.341032+00:00 app[web.1]: raise HaltServer(reason, self.APP_LOAD_ERROR) 2019-10-20T18:48:07.341077+00:00 app[web.1]: gunicorn.errors.HaltServer: 2019-10-20T18:48:07.34108+00:00 app[web.1]: 2019-10-20T18:48:07.341081+00:00 app[web.1]: During handling of the above exception, another exception occurred: 2019-10-20T18:48:07.341082+00:00 app[web.1]: 2019-10-20T18:48:07.341084+00:00 app[web.1]: Traceback (most recent call last): 2019-10-20T18:48:07.341087+00:00 app[web.1]: File "/app/.heroku/python/bin/gunicorn", line 11, in 2019-10-20T18:48:07.341187+00:00 app[web.1]: sys.exit(run()) 2019-10-20T18:48:07.341191+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py", line 61, in run 2019-10-20T18:48:07.341332+00:00 app[web.1]: WSGIApplication("%(prog)s [OPTIONS] [APP_MODULE]").run() 2019-10-20T18:48:07.341338+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/gunicorn/app/base.py", line 223, in run 2019-10-20T18:48:07.341481+00:00 app[web.1]: super(Application, self).run() 2019-10-20T18:48:07.341485+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/gunicorn/app/base.py", line 72, in run 2019-10-20T18:48:07.341594+00:00 app[web.1]: Arbiter(self).run() 2019-10-20T18:48:07.341596+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/gunicorn/arbiter.py", line 232, in run 2019-10-20T18:48:07.341733+00:00 app[web.1]: self.halt(reason=inst.reason, exit_status=inst.exit_status) 2019-10-20T18:48:07.341737+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/gunicorn/arbiter.py", line 345, in halt 2019-10-20T18:48:07.341907+00:00 app[web.1]: self.stop() 2019-10-20T18:48:07.341912+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/gunicorn/arbiter.py", line 393, in stop 2019-10-20T18:48:07.342087+00:00 app[web.1]: time.sleep(0.1) 2019-10-20T18:48:07.342103+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/gunicorn/arbiter.py", line 245, in handle_chld 2019-10-20T18:48:07.342235+00:00 app[web.1]: self.reap_workers() 2019-10-20T18:48:07.34225+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/gunicorn/arbiter.py", line 528, in reap_workers 2019-10-20T18:48:07.342455+00:00 app[web.1]: raise HaltServer(reason, self.APP_LOAD_ERROR) 2019-10-20T18:48:07.342497+00:00 app[web.1]: gunicorn.errors.HaltServer: 2019-10-20T18:48:07.398607+00:00 heroku[web.1]: Process exited with status 1 2019-10-20T18:48:07.340382+00:00 heroku[router]: at=error code=H13 desc="Connection closed without response" method=GET path="/" host=dash-app-iwas.herokuapp.com request_id=83c66979-c099-4f73-a736-ae8643738f23 fwd="178.4.195.229" dyno=web.1 connect=3ms service=4943ms status=503 bytes=0 protocol=https 2019-10-20T18:48:07.43426+00:00 heroku[web.1]: State changed from up to crashed 2019-10-20T18:48:12.50511+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=dash-app-iwas.herokuapp.com request_id=ab745857-ec0c-4cec-b2a4-b28f16deeb28 fwd="178.4.195.229" dyno=web.1 connect=5002ms service= status=503 bytes= protocol=https 2019-10-20T18:48:31+00:00 app[api]: Build started by user [email protected] 2019-10-20T18:49:18.55734+00:00 app[api]: Deploy 1c05a6c8 by user [email protected] 2019-10-20T18:49:18.55734+00:00 app[api]: Release v4 created by user [email protected] 2019-10-20T18:49:20.155422+00:00 heroku[web.1]: State changed from crashed to starting 2019-10-20T18:49:30.372836+00:00 heroku[web.1]: Starting process with command gunicorn -b :8496 app:app 2019-10-20T18:49:33.058813+00:00 app[web.1]: [2019-10-20 18:49:33 +0000] [4] [INFO] Starting gunicorn 19.9.0 2019-10-20T18:49:33.059689+00:00 app[web.1]: [2019-10-20 18:49:33 +0000] [4] [INFO] Listening at: http://0.0.0.0:8496 (4) 2019-10-20T18:49:33.059846+00:00 app[web.1]: [2019-10-20 18:49:33 +0000] [4] [INFO] Using worker: sync 2019-10-20T18:49:33.068014+00:00 app[web.1]: [2019-10-20 18:49:33 +0000] [10] [INFO] Booting worker with pid: 10

would be glad if someone could help me out I spend all day and can't fix it

The answer below fixed the problem.

1

1 Answers

1
votes

You need to set server instead of app in Procfile

In your Procfile change

web: gunicorn app:app to

web: gunicorn app:server

For more information refer to the official dash guideline https://dash.plot.ly/deployment