H14 - No web processes running on Heroku - previous posts with same concern doesn't resolve my issue. 550h eco dyno remaining but still not deployed [duplicate] - heroku

This question already has answers here:
H14 error in heroku - "no web processes running"
(22 answers)
Closed 11 days ago.
I have created a Flask-CRUD web application.
My app build is successful but is not deployed when I check the logs I get
`H14 No web processes running error`
I checked the dyno status through command
heroku ps and I got result
**Eco dyno hours quota remaining this month: 550h 0m** (100%) Eco dyno usage for this app: 0h 0m (0%)
My procfile is also named as Procfile (capital P)
web: gunicorn app: app
How can I resolve this my procfile is named as Procfile and I have also tried removing and adding back python buildpack

I think that the issue comes from the extra space in the Procfile after the ::
web: gunicorn app:app

Related

No web processes running [duplicate]

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
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.
After 3 hours of debugging, I've figured out why my app was causing this error:
My Procfile was incorrectly cased
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.
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
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
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
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!
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.
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.
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:
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.
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.
Change your Procfile file from
web:gunicorn to web gunicorn (remove the ':')
I fixed the issue by going to Configure Dynos and enabling the only dyno I had manually.
uff..that took some time,so the fixes i had to make were:
'Procfile' with upper case P.
web: gunicorn wsgi:app (with a space after web: in procfile)
Making sure the requirements.txt are in the root project folder.
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.
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.
Faced the exact same problem turns out I had the Profile in .gitignore
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
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:
To anyone who may come across this...
delete your Procfile
create 'Procfile' with upper case P.
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
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
deploy to heroku
heroku ps:scale web=1 (you can specify app name to like this heroku ps:scale web=1 -a appname
finally in terminal run heroku restart
heroku open
these are all the steps i took to get mine to work
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
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"

Heroku won't recognize Procfile in dynos at dashboard

Im trying to host my object detection api on heroku but i can't due to it not recognizing my
Procfile, which is a file and not a text file. the way its spelled is Procfile, its contents are
web:gunicorn app:app
the way i know that its the Procfile thats the problem is because when i run bash and look at the root directory of the heroku git i see Procfile but when i look at the logs i see that no web process is running and on the dashboard the dynos is completely empty.
i've tried doing
web: gunicorn app: app instead of web:gunicorn app:app
to no avail, i've made sure that gunicorn is in the requirements.txt and know that its pip installing the requirements.txt as the cmd tells me that it is when i do git push heroku master. i've tried doing echo>Procfile and then modifying the contents of the file. i've tried both echo "web:gunicorn app:app"> Procfile and echo web:gunicorn app:app>Procfile i tried doing heroku ps:scale web=1 and get Scaling web dynos... failed ! No such process type web defined in Procfile. and when i do heroku ps i get nothing

Couldn't find that process type (web)

So I'm doing a university group project and we are demonstrating tomorrow. It's a flask API and I'm hosting with Heroku. At first I got this error
code=H14 desc="No web processes running"
After looking around I found a solution to scale dynos with :
heroku ps:scale web=1
Which in turn failed, resulting in this error
Couldn't find that process type (web)
I have no idea what is going wrong. My Procfile is named correctly and updated (no .txt at the end). Any help would be greatly appreciated.
My Procfile:
web:gunicorn api_prediction:medi-ai
Where "api-prediction" is the python file to run and "medi-ai is the project name"
Example for the Procfile
#filename: Procfile
web: gunicorn runserver:app --log-file=-
Example for the gunicorn
# filename: run.gunicorn.sh
gunicorn -b :5000 --access-logfile - --error-logfile - runserver:app
Also install gunicorn and dont miss the requirements.txt file too.
pip install gunicorn
pip freeze > requirements.txt
If this doesn't resolved your issue please reply.

Heroku - prevent starting

I have a dyno on Heroku I use for one off jobs. I do not want it to "start". I added this in my Procfile:
heroku scale web=0
However it still tries to start every few hours as my log show:
=== web (Hobby): `npm start`
web.1: crashed 2015/09/29 07:28:12 (~ 4h ago)
How can I address this? When I searched for the solution the above Procfile entry was suggested.

Where's Procfile?

I'm trying to install New Relic, but it says I'll need to make changes to Procfile. I can't seem to find it at the root of the local copy of my app though. I'm using Django.
Thanks
This page on Heroku gives a lot more information on what the procfile is:
https://devcenter.heroku.com/articles/procfile
You don't have to have one to deploy to Heroku, but you can manually create one to take more control over how Heroku runs your apps. As per this excerpt from the link above:
A Procfile is not necessary to deploy apps written in most languages supported by Heroku. The platform automatically detects the language, and creates a default web process type to boot the application server.
Creating an explicit Procfile is recommended for greater control and flexibility over your app.
For Heroku to use your Procfile, add the Procfile to the root of your application push to Heroku:
$ git add .
$ git commit -m "Procfile"
$ git push heroku
...
-----> Procfile declares process types: web, worker
Compiled slug size is 10.4MB
-----> Launching... done
http://strong-stone-297.herokuapp.com deployed to Heroku
To git#heroku.com:strong-stone-297.git
* [new branch] master -> master
For New Relic support, you have to explicitly tell Heroku to run a gunicorn instance within New Relic. So your Procfile would look something like this:
newrelic-admin run-program gunicorn --workers 4 --worker-class gevent --timeout 60 mysite.wsgi
You can turn this on or off without changing your Procfile by conditionally looking for your New Relic licence in the Heroku environment variables:
Procfile:
web: bash scripts/heroku_run
scripts/heroku_run:
#!/bin/bash
run_command="gunicorn --workers 4 --worker-class gevent --timeout 60 mysite.wsgi"
# Run through New Relic monitoring if add-on installed
if [[ $NEW_RELIC_LICENSE_KEY != '' ]]; then
newrelic-admin run-program $run_command
else
$run_command
fi

Resources