148

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
Ron Miles
  • 1,503
  • 2
  • 11
  • 6

25 Answers25

215

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
  • 32,786
  • 20
  • 85
  • 109
  • 17
    should i write it in the procfile? – Ron Miles Jan 24 '17 at 10:32
  • 3
    amazing! i got this issue to trigger after putting in a malformed procfile and then correcting it – Luke May 31 '17 at 10:49
  • 1
    Weird, the dyno in the Heroku dashboard had to be disabled first. Thanks! – Stéphane Bruckert Mar 15 '18 at 16:53
  • Thanks! For some reason the embedded tomcat tutorial did not require me to do this, yet the webapprunner tutorial did. No clue why the difference. – KANJICODER Jul 11 '18 at 08:46
  • Man! One day trying to fix this, I am deploying a container to Heroku and I changed the `web` in `build` to my app's name, I didn't think that mattered... Heroku should be more clear on their tutorials. – jpenna May 21 '19 at 12:03
  • @jpenna please how did u deploy your containers to heroku. Been trying to do that for weeks. – medobills May 26 '19 at 08:45
  • @medobills I ran `heroku stack:set container` and then I created the `heroku.yml` file with `build: docker: web: Dockerfile`, and deployed it to Heroku using the `git push heroku master`. The problem was that I changed the `web: Dockerfile` to `myApp: Dockerfile`... Check this: https://devcenter.heroku.com/articles/build-docker-images-heroku-yml, I think it should work fine if you follow these steps and you have your Dockerfile correct and your containers are running fine locally. Tell if it works. – jpenna May 28 '19 at 04:24
  • wow thanks! i had this problem after downgrading the dyno and this one liner works! – Vina Feb 14 '20 at 09:14
  • 72
    Scaling dynos... ! ▸ Couldn't find that process type (web). – Charles Thayer Feb 24 '20 at 04:22
  • 2
    (ah ok, was missing a Procfile --very confusing unless you use their example code) – Charles Thayer Feb 24 '20 at 04:30
  • If you have already deployed without and dynos and are getting the error "Couldn't find that process type (web).", then you need to remove your buildpacks first, then set ps:scale, and then put the buildpacks back. See: https://help.heroku.com/W23OAFGK/why-am-i-seeing-couldn-t-find-that-process-type-when-trying-to-scale-dynos – Mark Hansen May 10 '20 at 20:24
  • I had the "Couldn't find that process type (web)" issue. The fix was to create a Procfile. I'm deploying a Django app so the file contained "web: gunicorn .wsgi". Full docs are here: https://devcenter.heroku.com/articles/procfile – Dylan Apr 16 '21 at 23:53
  • 1
    ! Couldn't find that process type (web). – kushagra-aa Aug 20 '21 at 16:27
  • 1
    Doesn't work any more if you come from a free plan. You are forced to eco now. – Wolfgang Fahl Dec 18 '22 at 14:41
47

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
  • 9,056
  • 2
  • 45
  • 69
  • 2
    To clarify, `Procfile` is correctly cased and `procfile` is **not** correctly cased. It should start with a capital P. – NecipAllef Oct 19 '22 at 19:41
20

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
  • 224
  • 2
  • 4
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
  • 161
  • 1
  • 5
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
  • 71
  • 1
  • 6
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
  • 71
  • 1
  • 1
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!

double-beep
  • 5,031
  • 17
  • 33
  • 41
Aris Laode
  • 81
  • 1
  • 3
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.

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
  • 940
  • 8
  • 19
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.

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
  • 4,421
  • 2
  • 37
  • 53
1

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

Prince
  • 11
  • 1
1

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

santaclos
  • 326
  • 3
  • 4
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
  • 37
  • 5
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
  • 7,846
  • 5
  • 31
  • 33
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.

0

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

Fahim
  • 1
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

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
  • 2,591
  • 2
  • 11
  • 29
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

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

Julia Meshcheryakova
  • 3,162
  • 3
  • 22
  • 42
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.
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Blue Robin Mar 07 '23 at 21:15
0

Try scale down the dyno first.

heroku ps:scale web=0 

Then scale it up.

heroku ps:scale web=1
Gundam Meister
  • 1,425
  • 2
  • 19
  • 29
-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"
Webdeveloper_Jelle
  • 2,868
  • 4
  • 29
  • 55
LIOC
  • 1
  • 2