H14 error in heroku - "no web processes running"

PythonHtmlDjangoHerokuWeb Deployment

Python Problem Overview


error H14 happen while deploying to heroku this is my procfile:

web: gunicorn -w 4 -b 0.0.0.0:$PORT -k gevent main:app

log on heroku:

2017-01-23T10:42:58.904480+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=meetcapstone.herokuapp.com request_id=df88efb5-a81a-4ac0-86dc-4e03d71266bb fwd="81.218.117.137" dyno= connect= service= status=503 bytes=
2017-01-23T10:42:59.009135+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=meetcapstone.herokuapp.com request_id=21cea981-36b0-4410-891f-548bbc29f0ee fwd="81.218.117.137" dyno= connect= service= status=503 bytes=

requirements:

Flask==0.11.1
passlib==1.7.0
SQLAlchemy==1.1.5
Werkzeug==0.11.15
gunicorn==19.0.0
gevent==1.2.1

Python Solutions


Solution 1 - Python

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.

Solution 2 - Python

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.

>More info on dyno configuration – more on initializing your heroku app.

Solution 3 - Python

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

Solution 4 - Python

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

Solution 5 - Python

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

Solution 6 - Python

  • 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!

Solution 7 - Python

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.

Solution 8 - Python

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.

Solution 9 - Python

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

Solution 10 - Python

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

Solution 11 - Python

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.

Solution 12 - Python

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.

Solution 13 - Python

Change your Procfile file from web:gunicorn to web gunicorn (remove the ':')

Solution 14 - Python

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.

Solution 15 - Python

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.

Solution 16 - Python

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

Solution 17 - Python

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 .wsgi

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionRon MilesView Question on Stackoverflow
Solution 1 - PythonrdeggesView Answer on Stackoverflow
Solution 2 - PythonYaakov BresslerView Answer on Stackoverflow
Solution 3 - PythonMaxwellView Answer on Stackoverflow
Solution 4 - PythonbshView Answer on Stackoverflow
Solution 5 - PythontheMikusView Answer on Stackoverflow
Solution 6 - PythonAris LaodeView Answer on Stackoverflow
Solution 7 - PythonAustin FischerView Answer on Stackoverflow
Solution 8 - PythonDries De DeckerView Answer on Stackoverflow
Solution 9 - PythonGarry TaylorView Answer on Stackoverflow
Solution 10 - PythonsantaclosView Answer on Stackoverflow
Solution 11 - PythonDivyanshu RawatView Answer on Stackoverflow
Solution 12 - PythonShyamView Answer on Stackoverflow
Solution 13 - PythonPrince View Answer on Stackoverflow
Solution 14 - PythonjmozView Answer on Stackoverflow
Solution 15 - PythonShan Chen YOUView Answer on Stackoverflow
Solution 16 - PythonFahimView Answer on Stackoverflow
Solution 17 - PythonLyle RogersView Answer on Stackoverflow