When you are deploying your app on Heroku, you might face code=h14 desc= no web processes running error. This error simply means that the web processing of your app gives an error and your app was not able to run on the web application. In this short article, we will learn how you can solve the code=h14 desc= no web processes running error which usually occurs while deploying an app to the Heroku website.
Code=h14 desc= no web processes running – Possible solutions
I was working on the dashboard that I created using the Plolty module. After completing the dashboard, I followed all steps in order to deploy my app on Heroku so that I can share my application with other people as well.
But guess what, I got code=h14 desc= no web processes running error. It took me hours to figure out the actual problem. However, there can be different reasons for getting this error because it says our application is not able to run on the web. Depending on your problem and the cause of the error, there can be many possible solutions to solve this error. In this section, we will try to go through various possible reasons and solutions to this problem.
Solution-1: Check the Procfile
In my case, I mistyped the Procfile name, so the app was not able to run on the web. Please make sure every file that you have created in your virtual machine have proper and correct names.
Make sure that your Procfile contains the following code inside it:
web: gunicorn app:server
Here the app means, the name of your main Python file. In my case the name of the file is app.py so I had written app there. In your case, please write the name of the application without .py.
Solution-2: Other possible solutions to the problem
There can be many other reasons for getting this error as well.
Possible Reason and solution:
It can be possible that some of your files (mainly the gunicorn or Procfile) are not in the virtual environment. So make sure that every file and library are installed in the virtual environment and added in the requirements.txt file
You can run the web by force:
If everything is fine, but still facing the error, then you can run the web dynos by forcing the Heroku. You can run the following commands in the terminal in order to run web dynos:
heroku ps:scale web=1
Hopefully, now you will not get the error anymore.
Alternative steps to solve the problem:
- 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.
Steps for creating and deploying and app into Heroku
If you want to do everything from the beginning, then please following the following commands:
- delete your Procfile
- create ‘Procfile’ with upper case P.
- in your Procfile type:
web: gunicorn :app (with a space after web: in procfile)mine for example was web: gunicorn app:server 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
In this short article, we discussed the reasons for getting code=h14 desc= no web processes running error. We solved the problem using various possible methods.
- SyntaxError: non-default argument follows default argument
- AttributeError: ‘str’ object has no attribute ‘decode’
- IndentationError: expected an indented block