Search code examples
pythonherokuweb-deploymentplotly-dash

Deploy dash with Heroku in error state after building successfully


I wrote a simple dashboard using Python and Dash. I tried to deploy it in Heroku and it successfully builds but then the app is in a error state.

Following is part the logfile (it's too long but I can provide it for help!). I can't understand the error and I paste here the complete log.

heroku logs --tail
 ›   Warning: heroku update available from 7.35.0 to 7.42.1.
2020-06-08T21:50:02.817849+00:00 app[web.1]: self.sleep()
2020-06-08T21:50:02.817885+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 360, in sleep
2020-06-08T21:50:02.818331+00:00 app[web.1]: ready = select.select([self.PIPE[0]], [], [], 1.0)
2020-06-08T21:50:02.818366+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 245, in handle_chld
2020-06-08T21:50:02.818656+00:00 app[web.1]: self.reap_workers()
2020-06-08T21:50:02.818694+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 528, in reap_workers
2020-06-08T21:50:02.819143+00:00 app[web.1]: raise HaltServer(reason, self.APP_LOAD_ERROR)
2020-06-08T21:50:02.819238+00:00 app[web.1]: gunicorn.errors.HaltServer: <HaltServer 'App failed to load.' 4>
2020-06-08T21:50:02.819239+00:00 app[web.1]: 
2020-06-08T21:50:02.819240+00:00 app[web.1]: During handling of the above exception, another exception occurred:
2020-06-08T21:50:02.819240+00:00 app[web.1]: 
2020-06-08T21:50:02.819245+00:00 app[web.1]: Traceback (most recent call last):
2020-06-08T21:50:02.819272+00:00 app[web.1]: File "/app/.heroku/python/bin/gunicorn", line 8, in <module>
2020-06-08T21:50:02.819419+00:00 app[web.1]: sys.exit(run())
2020-06-08T21:50:02.819420+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/app/wsgiapp.py", line 61, in run
2020-06-08T21:50:02.819576+00:00 app[web.1]: WSGIApplication("%(prog)s [OPTIONS] [APP_MODULE]").run()
2020-06-08T21:50:02.819580+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/app/base.py", line 223, in run
2020-06-08T21:50:02.819779+00:00 app[web.1]: super(Application, self).run()
2020-06-08T21:50:02.819785+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/app/base.py", line 72, in run
2020-06-08T21:50:02.819951+00:00 app[web.1]: Arbiter(self).run()
2020-06-08T21:50:02.819956+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 232, in run
2020-06-08T21:50:02.820155+00:00 app[web.1]: self.halt(reason=inst.reason, exit_status=inst.exit_status)
2020-06-08T21:50:02.820160+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 345, in halt
2020-06-08T21:50:02.820395+00:00 app[web.1]: self.stop()
2020-06-08T21:50:02.820400+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 393, in stop

Solution

  • Following THIS instructions, I had to add this:

    server = app.server