Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django: Heroku Failing to launch, at=error code=H10 desc="App crashed"

Tags:

git

django

heroku

Trying to Launch an application on Heroku and for the past few weeks I just cannot seem to get past this error. I setup my repo correctly and everything pushed to Heroku via git then when I open my site via the link given to me, I see the application failure error message. I view my logs but cannot seem to decipher where the error is coming from or how to begin to debug. If anyone can help that would be amazing! Thank you!

My log message below:

2015-02-02T04:01:38.814574+00:00 heroku[web.1]: Starting process with command `gunicorn indie_app.wsgi`
2015-02-02T04:01:39.881951+00:00 app[web.1]: Traceback (most recent call last):
2015-02-02T04:01:39.881989+00:00 app[web.1]:     sys.exit(run())
2015-02-02T04:01:39.882016+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 74, in run
2015-02-02T04:01:39.881966+00:00 app[web.1]:   File "/app/.heroku/python/bin/gunicorn", line 11, in <module>
2015-02-02T04:01:39.882149+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/base.py", line 71, in run
2015-02-02T04:01:39.882183+00:00 app[web.1]:     Arbiter(self).run()
2015-02-02T04:01:39.882250+00:00 app[web.1]:     self.manage_workers()
2015-02-02T04:01:39.882055+00:00 app[web.1]:     WSGIApplication("%(prog)s [OPTIONS] [APP_MODULE]").run()
2015-02-02T04:01:39.882129+00:00 app[web.1]:     super(Application, self).run()
2015-02-02T04:01:39.882077+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/base.py", line 185, in run
2015-02-02T04:01:39.882210+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/arbiter.py", line 169, in run
2015-02-02T04:01:39.882270+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/arbiter.py", line 477, in manage_workers
2015-02-02T04:01:39.882356+00:00 app[web.1]:     self.spawn_workers()
2015-02-02T04:01:39.882376+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/arbiter.py", line 542, in spawn_workers
2015-02-02T04:01:39.882473+00:00 app[web.1]:     time.sleep(0.1 * random.random())
2015-02-02T04:01:39.882563+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/arbiter.py", line 459, in reap_workers
2015-02-02T04:01:39.882493+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/arbiter.py", line 209, in handle_chld
2015-02-02T04:01:39.882652+00:00 app[web.1]:     raise HaltServer(reason, self.WORKER_BOOT_ERROR)
2015-02-02T04:01:39.882741+00:00 app[web.1]: gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3>
2015-02-02T04:01:39.882542+00:00 app[web.1]:     self.reap_workers()
2015-02-02T04:01:40.654279+00:00 heroku[web.1]: Process exited with status 1
2015-02-02T04:01:40.673618+00:00 heroku[web.1]: State changed from starting to crashed
2015-02-02T04:01:40.674364+00:00 heroku[web.1]: State changed from crashed to starting
2015-02-02T04:01:50.369085+00:00 heroku[web.1]: Starting process with command `gunicorn indie_app.wsgi`
2015-02-02T04:01:52.540605+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/base.py", line 185, in run
2015-02-02T04:01:52.540682+00:00 app[web.1]:     super(Application, self).run()
2015-02-02T04:01:52.540719+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/base.py", line 71, in run
2015-02-02T04:01:52.540770+00:00 app[web.1]:     Arbiter(self).run()
2015-02-02T04:01:52.540800+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/arbiter.py", line 169, in run
2015-02-02T04:01:52.540859+00:00 app[web.1]:     self.manage_workers()
2015-02-02T04:01:52.540886+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/arbiter.py", line 477, in manage_workers
2015-02-02T04:01:52.541011+00:00 app[web.1]:     self.spawn_workers()
2015-02-02T04:01:52.541038+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/arbiter.py", line 542, in spawn_workers
2015-02-02T04:01:52.541156+00:00 app[web.1]:     time.sleep(0.1 * random.random())
2015-02-02T04:01:52.541181+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/arbiter.py", line 209, in handle_chld
2015-02-02T04:01:52.541248+00:00 app[web.1]:     self.reap_workers()
2015-02-02T04:01:52.541276+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/arbiter.py", line 459, in reap_workers
2015-02-02T04:01:52.541383+00:00 app[web.1]:     raise HaltServer(reason, self.WORKER_BOOT_ERROR)
2015-02-02T04:01:52.541508+00:00 app[web.1]: gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3>
2015-02-02T04:01:52.540589+00:00 app[web.1]:     WSGIApplication("%(prog)s [OPTIONS] [APP_MODULE]").run()
2015-02-02T04:01:52.540379+00:00 app[web.1]:   File "/app/.heroku/python/bin/gunicorn", line 11, in <module>
2015-02-02T04:01:52.540315+00:00 app[web.1]: Traceback (most recent call last):
2015-02-02T04:01:52.540502+00:00 app[web.1]:     sys.exit(run())
2015-02-02T04:01:52.540530+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 74, in run
2015-02-02T04:01:53.479723+00:00 heroku[web.1]: Process exited with status 1
2015-02-02T04:01:53.497538+00:00 heroku[web.1]: State changed from starting to crashed
2015-02-02T04:01:53.908609+00:00 heroku[api]: Scale to web=1 by [email protected]
2015-02-02T04:02:04.383428+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=salty-refuge-1024.herokuapp.com request_id=1abfe0da-fbd2-45f8-bd2f-52b5423acf6b fwd="24.228.44.221" dyno= connect= service= status=503 bytes=
2015-02-02T04:02:04.774497+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=salty-refuge-1024.herokuapp.com request_id=bf481dcb-e6d2-4620-b19c-982b5bd3d531 fwd="24.228.44.221" dyno= connect= service= status=503 bytes=
2015-02-02T04:02:04.689179+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=salty-refuge-1024.herokuapp.com request_id=46733f84-e2b4-4b0a-9733-e70cbc0f2d95 fwd="24.228.44.221" dyno= connect= service= status=503 bytes=
like image 336
Amechi Avatar asked Feb 02 '15 04:02

Amechi


3 Answers

The same error occurs when the gunicorn package is not installed (in your virtualenv). Here is a similar traceback as of October 2016:

2016-10-21T08:35:56.041002+00:00 heroku[router]: at=error code=H10 
desc="App crashed" method=GET path="/" host=mygreatapp.herokuapp.com 
request_id=blablabla fwd="188.73.193.22" dyno= connect= service= 
status=503 bytes=

I was so impatient and during the conversion of my local app to a Heroku one (which includes the creation of Procfile, runtime.txt, .gitignore files, installation of dj-database-url, whitenoise) I forgot to install the most important package (pip install gunicorn)!!!

Doing so, H10 error vanished!

cheers!

like image 89
nik_m Avatar answered Oct 21 '22 14:10

nik_m


It looks like heroku can't start the webserver and so changed the app status to crashed. Everytime when I get this error code the Procfile was misconfigured or had errors.

like image 20
t_io Avatar answered Oct 21 '22 14:10

t_io


i was also getting similiar problem then changed Procfile and it worked previously

web: gunicorn django_project.wsgi

edited

web: gunicorn django_project.wsgi:application --log-file - --log-level debug
python manage.py collectstatic --noinput
manage.py migrate
like image 7
ANUBH4B4 Avatar answered Oct 21 '22 15:10

ANUBH4B4