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

20πŸ‘

βœ…

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.

πŸ‘€t_io

51πŸ‘

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!

πŸ‘€nik_m

7πŸ‘

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
πŸ‘€ANUBH4B4

4πŸ‘

For users who are deploying the Django app via heroku for the first time, make sure you give the correct app name in the Procfile. I made this mistake during my first deployment.

web: gunicorn appname.wsgi:application --log-file - --log-level debug
python manage.py collectstatic --noinput
manage.py migrate

Here "appname" is name of my project where settings.py file is present.

0πŸ‘

i got this error due to new whitenoise configuration. i changed it and it works now.

Your WhiteNoise configuration is incompatible with WhiteNoise v4.0
2020-08-22T08:14:04.757895+00:00 app[web.1]: This can be fixed by following the upgrade instructions at:
2020-08-22T08:14:04.757895+00:00 app[web.1]:
check out this site for new configuration => http://whitenoise.evans.io/en/stable/changelog.html#v4-0

0πŸ‘

This error mostly caused by the misconfiguration of Procfile.

I had the same problem and which was an extra space between web and : in my Procfile.
After fixing that the app worked.

0πŸ‘

web: gunicorn djang_project_name.wsgi:application --log-file - --log-level debug
heroku ps:scale web=1
python manage.py migrate

This solved my problem.

I previously did the part of python manage.py collectstatic

0πŸ‘

Here is how I solved this error the first time I was deploying on heroku:
Previously my Procfile was:

web: gunicorn movierater.wsgi --log-file-

Edited that to:

web: gunicorn movierater.wsgi --log-file -

The space after file was missing. After that run,
git add .
git commit -m "message"
git push heroku main --force

πŸ‘€Shaheer

-1πŸ‘

Add gunicorn in requirement.txt done!!
I wasted hour with this error.

make sure you have Procfile:

web: gunicorn --bind 0.0.0.0:$PORT project_name:app

remember to ip should be 0.0.0.0

and add requirement file with gunicorn.

Leave a comment