Why cant I add dynos to my heroku project? - heroku

I have tried everything and cannot figure out why it wont create dynos. I have a java web app using maven, deploys to heroku successfully but does not have dynos.
Procfile declares types -> (none) but why?
My error:
at=error code=H14 desc="No web processes running" method=GET path= method=GET path="/list" host=employee-db10.herokuapp.com request_id=some_request_id fwd="XX.XXX.XX.XXXX" dyno= connect= service= status=503 bytes= protocol=https
My procfile is as follows:
web: java $JAVA_OPTS -jar target/dependency/webapp-runner.jar --port $PORT target/*.war
I have also tried this for my procfile and it did not work:
web: java -jar target/dependency/webapp-runner.jar target/*.war --port $PORT
I also see this in my build log and it could also be a problem. I tried building this using a war earlier and switched over to webapp-runner after reading online.
remote: [WARNING] Some problems were encountered while building the effective model for jsp-servlet-jdbc-mysql-example:jsp-servlet-jdbc-mysql-example:war:0.0.1-SNAPSHOT

You can use the heroku ps:scale command to add (or remove) dynos at will:
heroku ps:scale web=1
This command will instruct Heroku to run a single web process (as specified in your Procfile). If you'd like to have 2 dynos, you could say:
heroku ps:scale web=2
Etc. Here's an article from Heroku's docs that explain it in more detail.

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[router]: at=error code=H14 desc="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"

Springboot 2 RESTful application deployed to heroku using Procfile

I've tried numerous configurations to deploy my Restful Springboot 2 app to heroku using a procfile to no avail. I've tried several of the suggestions/solutions here.
Procfile:
web: java $JAVA_OPTS -Dspring.profiles.active=stage -cp target/classes:target/libs/* com.rabbittab.RestFulApp
Heroku logs:
2020-04-24T14:57:59.344561+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/".
Greatly appreciate any help with this.
add -Dserver.port=$PORT to the Procfile.
I think the problem is that your app does not bind to the port provided by Heroku.

Deploy an app to Heroku that isnt in the project root?

I need to deploy a node application that isn't in the root of my project.
My project is similar to this: https://github.com/graphql-boilerplates/react-fullstack-graphql/tree/master/advanced
In the root of the project is a React app but I dont want to deploy this. In a folder called “server” there is my node server and this is what I need to deploy to Heroku.
When I deploy Heroku appears to run npm run start on the top level package.json. How can I make Heroku ignore this and just run the package.json in the /server folder?
Update: Ive created a Procfile in my project root with the following:
web: ./server npm run start
But when I deploy I get an application error:
2018-07-05T12:41:51.627168+00:00 app[api]: Release v4 created by user MYEMAIL#gmail.com
2018-07-05T12:41:59.000000+00:00 app[api]: Build succeeded
2018-07-05T12:42:02.176695+00:00 heroku[web.1]: Starting process with command `./server npm run start`
2018-07-05T12:42:04.817337+00:00 heroku[web.1]: State changed from starting to crashed
2018-07-05T12:42:04.701159+00:00 app[web.1]: bash: ./server: Is a directory
2018-07-05T12:42:04.782252+00:00 heroku[web.1]: Process exited with status 126
2018-07-05T12:42:11.974345+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=DEPLOY-NAME.herokuapp.com request_id=c2cba42e-80af-4b16-95sdfdfd-2918 fwd="86.343.251.15" dyno= connect= service= status=503 bytes= protocol=https
Check out heroku-prebuild script. I have an API app and a react app that are both served by Express but in different folders. Put package.json in the root and use heroku-prebuild to move around to other folders.
{
"scripts": {
"heroku-prebuild": "cd app && npm install && npm run build && cd .. && cd api && npm install",
"start": "cd api && npm start"
}
}
If you use buildpacks, this solution is probably the cleaner one.
You just have to use this custom Buildpack :
https://elements.heroku.com/buildpacks/timanovsky/subdir-heroku-buildpack
heroku buildpacks:clear
heroku buildpacks:set https://github.com/timanovsky/subdir-heroku-buildpack
heroku buildpacks:add heroku/nodejs
heroku config:set PROJECT_PATH=projects/nodejs/frontend
Deploy your project to Heroku.
You can change this behaviour by defining a Procfile that overrides start: https://devcenter.heroku.com/articles/nodejs-support#default-web-process-type
Ive messaged Heroku support and they pretty much said they don't support deploying a node app that's not in the project root.
Im going to split my project up but you could probably do it with git subtree.

Error H14 (No web processes running) deploy on Heroku

I try to create simple java App on Heroku.
I following step by step from http://samuelsharaf.wordpress.com/2011/11/06/create-a-simple-java-web-app-using-maven-and-upload-to-heroku/ to do it.
But when i try to deploy my app on heroku project i got error message like bellow when i try to view log
$ heroku logs -t
2012-07-10T02:15:14+00:00 heroku[slugc]: Slug compilation started
2012-07-10T02:15:27+00:00 heroku[api]: Add shared-database:5mb add-on by anwar#meruvian.org
2012-07-10T02:15:27+00:00 heroku[api]: Release v2 created by anwar#meruvian.org
2012-07-10T02:15:27+00:00 heroku[api]: Add MAVEN_OPTS, PATH, JAVA_OPTS config by anwar#meruvian.org
2012-07-10T02:15:27+00:00 heroku[api]: Release v3 created by anwar#meruvian.org
2012-07-10T02:15:28+00:00 heroku[api]: Release v4 created by anwar#meruvian.org
2012-07-10T02:15:28+00:00 heroku[api]: Deploy cb1cfa2 by anwar#meruvian.org
2012-07-10T02:15:28+00:00 heroku[web.1]: State changed from starting to down
2012-07-10T02:15:28+00:00 heroku[slugc]: Slug compilation finished
2012-07-10T02:16:51+00:00 heroku[router]: Error H14 (No web processes running) -> GET fierce-ocean-9944.herokuapp.com/ dyno= queue= wait= service= status=503 bytes=
This is my url on heroku :
http://fierce-ocean-9944.herokuapp.com/
What that error ?
How to solve this ?
Thanks
Have you tried scaling one of your process types? e.g. heroku ps:scale web=1
Or rather, check what's your current web count by using 'heroku ps'
See https://devcenter.heroku.com/articles/scaling
I kept running into the same problem. The sample python application ran fine, but mine did not. I logged into the dashboard and noticed that the web dyno count for my app showed zero. So I bumped it up on the web gui (i.e., strech the slider widget until you get a non-zero count.) and that worked. My dashboard also showed the heroku ps:scale web=1 dyno at zero, and I left it as zero.
You need to remove your ProcFile and add again
git rm ProcFile –f
Again add the ProcFile to project
Check the spellings
Content structure of the ProcFile
ProcFile should not contain any extensions.
After that do the normal git procedure,
git add .
git commit –m “add procfile”
git push heroku master
You will see,
Procfile declares types -> web
Instead of
Procfile declares types -> (none)
If you are using a container to build a web application, create a heroku.yaml file like this in your project's root:
build:
docker:
web: Dockerfile
run:
web: [PUT YOUR CMD COMMAND IN DOCKERFILE HERE]
Then add heroku.yaml to git repository. You can remove Procfile (optional). Finally deploy your repository as the following:
git add .
git commit -m "Add heroku.yml"
heroku stack:set container -a [YOUR APP NAME]
git push heroku master
If your are pushing to heroku for the first time, you should run heroku git:remote -a [YOUR APP NAME] before git push heroku master

Resources