[Django]-H14 error in heroku โ€“ "no web processes running"

219๐Ÿ‘

The issue here is that youโ€™re not running any web dynos. You can tell Heroku to do this via:

$ heroku ps:scale web=1

This will force Heroku to spin up a web dyno, thereby executing your gunicorn command.

๐Ÿ‘คrdegges

48๐Ÿ‘

After 3 hours of debugging, Iโ€™ve figured out why my app was causing this error:

  1. My Procfile was incorrectly cased
  2. gunicorn wasnโ€™t installed in my venv

IMO, this error should be raised on Herokuโ€™s end. As a beginner, this sort of error is difficult to trace.

Update:
To clarify, Procfile is correctly cased and procfile is not correctly cased. It should start with a capital "P".

More info on dyno configuration โ€“ more on initializing your heroku app.

๐Ÿ‘คYaakov Bressler

21๐Ÿ‘

I ran into the same problem but from a different cause. I had the hobby tier, but then canceled it and reverted back to the free tier. Doing this caused the error and how I fixed it was just re running the command from the cli:

heroku ps:scale web=1
๐Ÿ‘คMaxwell

15๐Ÿ‘

Before this command:

heroku ps:scale web=1

I had to remove and add buildpacks again and empty commit it and redeploy it to heroku.

heroku buildpacks:clear
heroku buildpacks:add --index heroku/python
๐Ÿ‘คbsh

9๐Ÿ‘

My issue is that Heroku removed the free plans. To solve such an issue go to Heroku and select/change your free plan to for example "eco" plan.

๐Ÿ‘คKhalid Seflan

7๐Ÿ‘

I was having an issue here too. My problem was that my Procfile was โ€œProcfile.txtโ€ .
What solved my issue was to remove the file extension from Procfile, then recommit
and push stuff to heroku

๐Ÿ‘คtheMikus

7๐Ÿ‘

  • Login to your Heroku dashboard and open your projects.
  • Go to Settings.
  • Delete heroku/python from the list of buildpacks
  • Then click Add buildpack โ†’ Choose "Python" โ†’ Save Changes.
  • Activate your environment in your code.
  • Run heroku ps:scale web=1.

And youโ€™re done!

๐Ÿ‘คAris Laode

7๐Ÿ‘

This isnโ€™t the problem with your code, but Iโ€™ve gotten this error message a couple of times now and the mistake that Iโ€™ve made that has caused it has been writing

web:gunicorn

instead of

web: gunicorn

That space can really cause a lot of issues.

๐Ÿ‘คAustin Fischer

7๐Ÿ‘

I have a UAT version I only enable during client development.

I have a custom dyno script but itโ€™s turned to the free version. So the app was not starting as my script was not running. When I enabled the Dyno the toggle was still off :rolleyes:

enter image description here

๐Ÿ‘คGarry Taylor

2๐Ÿ‘

I donโ€™t have the reputation to reply to the correct comment, but for me the issue was that I didnโ€™t have the run.gunicorn.sh file in my root directory, this resulted in the same "No web processes running" error.

If you donโ€™t have this file, create it with contents:

gunicorn -b :5000 --access-logfile - --error-logfile - build:app

Where โ€˜buildโ€™ is the name of your python file (build.py in this case) and app is the name of your app in the code.

Also make sure that gunicorn is included in requirements.txt, like others have already pointed out.

๐Ÿ‘คDries De Decker

2๐Ÿ‘

Yeah I was also using web heroku-php-apache2 dyno and reverted it back to free tier and that caused the dyno to sleep fortunately executing heroku ps:scale web=1 -a <app name> did the magic.

๐Ÿ‘คDivyanshu Rawat

1๐Ÿ‘

Change your Procfile file from
web:gunicorn to web gunicorn (remove the โ€˜:โ€™)

๐Ÿ‘คPrince

1๐Ÿ‘

I fixed the issue by going to Configure Dynos and enabling the only dyno I had manually.

๐Ÿ‘คsantaclos

1๐Ÿ‘

uff..that took some time,so the fixes i had to make were:

  1. โ€˜Procfileโ€™ with upper case P.
  2. web: gunicorn wsgi:app (with a space after web: in procfile)
  3. Making sure the requirements.txt are in the root project folder.
๐Ÿ‘คShyam

1๐Ÿ‘

Sometimes running heroku ps:scale web=1 does not fix the issue, a workaround i found useful is scaling up the dynos then scaling them down to your initial price i.e bumping it to 25$ then scaling it back to 7$

0๐Ÿ‘

I was missing dynos on the web gui. The cli command to scale did not work. I also may have had an incorrect run:web declaration with missing $PORT. To fix:

heroku.yml must have a web declaration using the $PORT var:

build:
  docker:
    web: Dockerfile
run:
  web: uvicorn main:app --reload --host 0.0.0.0 --port $PORT

I then pushed to heroku.

After that it must have added the web dyno, I could then run:

heroku ps:scale web=1

And now the fastapi uvicorn runs.

๐Ÿ‘คjmoz

0๐Ÿ‘

Pay attention to the Procfile naming and location (https://devcenter.heroku.com/articles/procfile) The Procfile is always a "simple text file" that is named Procfile without a file extension.(Procfile.txt not acceptable!) The Procfile must live in your appโ€™s root directory. It does not function if placed anywhere else.

๐Ÿ‘คShan Chen YOU

0๐Ÿ‘

Faced the exact same problem turns out I had the Profile in .gitignore

๐Ÿ‘คFahim

0๐Ÿ‘

I was placing my django Procfile in the directory with settings.py and not the root directory and that gave me the H14 error. I fixed the error with this and I didnโ€™t need to do anything else they say.

Procfile

web: gunicorn <django-root-name(containing wsgi)>.wsgi

๐Ÿ‘คLyle Rogers

0๐Ÿ‘

There are many things that can go wrong here. Its a combination of poor shepherding by heroku and ambiguous use between flask & gunicorn.

Here is a good guide that will get you up and running:

๐Ÿ‘คSergio Bost

0๐Ÿ‘

To anyone who may come across thisโ€ฆ

  1. delete your Procfile
  2. create โ€˜Procfileโ€™ with upper case P.
  3. in your Procfile type: web: gunicorn <nameOfRootFile>:app (with a space after web: in procfile) mine for example was web: gunicorn app:app another way I wrote it that worked was this: web: gunicorn -w 4 "app:create_app()" -t 120
  4. Making sure the requirements.txt are in the root project folder. (you can run pip freeze > requirements.txt if you do not have the file created
  5. deploy to heroku
  6. heroku ps:scale web=1 (you can specify app name to like this heroku ps:scale web=1 -a appname
  7. finally in terminal run heroku restart
  8. heroku open

these are all the steps i took to get mine to work

๐Ÿ‘คBrian Mojica

0๐Ÿ‘

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

this worked for me, just make sure your Procfile is in the right format, and specify the app you are connecting to, in my case itโ€™s the weather app. Enjoy

๐Ÿ‘คAdeniran Tobi

0๐Ÿ‘

I faced the same issue because my application was deployed on the free plan before and its size was more than 300MB. The application worked fine again when I did the following:

  1. Upgrade account to eco plan
  2. Deleted the application
  3. Create new application on heroku for the same project and deployed
    it.
๐Ÿ‘คHatem Gadallah

0๐Ÿ‘

Try scale down the dyno first.

heroku ps:scale web=0 

Then scale it up.

heroku ps:scale web=1
๐Ÿ‘คGundam Meister

-1๐Ÿ‘

What worked for me was adding on the second line of the procfile:

heroku ps:scale web=1

The first line must contain:

web: gunicorn "filename":"main method name"
๐Ÿ‘คLIOC

Leave a comment