'Couldn't find that process type, Heroku

I'm trying to deploy a simple python bot on Heroku but I get the error
couldn't find that process type

When I try to scale the dynos. I already made a procfile and it looks like this:
web: gunicorn dep:app, where "dep" is the name of my python code

What could be the reason?



Solution 1:[1]

This may happen if your procfile is misspelt, such as "procfile" or "ProcFile" etc. The file name should be "Procfile" (with a capital P).

sometimes changing the file name is not anough, because git wouldn't spot the change. I had to delete the Procfile completely, then commit the change, than add it again with the right name, and then commit that again:

  1. remove your procfile
  2. git commit
  3. add a new procfile with the exact name "Procfile"
  4. commit again
  5. git push heroku master (or main - new heroku projects now uses main)

should work!

Solution 2:[2]

Make Sure Procfile should not have any extension like .txt otherwise this will be the error

remote: -----> Discovering process types remote: Procfile declares types -> (none)

To create file without extension type following in cmd notepad Procfile. Now add web: gunicorn dep:app and save Now when you will git push heroku master the above lines will be like

remote: -----> Discovering process types remote: Procfile declares types -> web

And the error is gone when you will run

C:\Users\Super-Singh\PycharmProjects\URLShortener>heroku ps:scale web=1

Scaling dynos... done, now running web at 1:Free

Solution 3:[3]

Ensure that the Procfile is in the root directory of your repository.

In my case I had initially kept the Procfile in a subdirectory. Moving it to the root directory solved the problem.

For people who are trying to deploy a django web app, take note that the above step may cause another issue - of heroku unable to reach till the wsgi file residing in the subdirectory.

I solved it by referring to the below thread -

How can I modify Procfile to run Gunicorn process in a non-standard folder on Heroku?

Solution 4:[4]

The following worked for me.

As per this Heroku help page:

To fix:

Remove the existing buildpacks with heroku buildpacks:clear. You will need to add an empty commit and redeploy for the changes to take effect:

git commit --allow-empty -m "Adjust buildpacks on Heroku"

git push heroku master

Solution 5:[5]

You might check your python version. I tried to deploy my Django project so my procfile looks like this web: gunicorn blog.wsgi --log-file - and I also got the same error couldn't find that process type. and I found that Heroku only support python-3.6.4 and python-2.7.14 while I just had python3.5. You can type:

python -V

to see what python version you are using now. if not, you can download python 3.6. I followed this How do I install Python 3.6 using apt-get?

Ubuntu 14.04 and 16.04

If you are using Ubuntu 14.04 or 16.04, you can use Felix Krull's deadsnakes PPA at https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa:

sudo add-apt-repository ppa:deadsnakes/ppa

sudo apt-get update

sudo apt-get install python3.6

Alternatively, you can use J Fernyhough's PPA at https://launchpad.net/~jonathonf/+archive/ubuntu/python-3.6:

sudo add-apt-repository ppa:jonathonf/python-3.6

sudo apt-get update

sudo apt-get install python3.6

and remember to keep you python 3.5. Don't remove it. and specify your python version in the runtime.txt file: python-3.6.4 and run:

heroku ps:scale web=1 --app [my app's name]

and the problem solved. I hope my answer might help you.

Solution 6:[6]

While it's not Python, in my case, I had heroku/java followed by heroku/pgbouncer. In Heroku's Settings, I switched them so heroku/pgbouncer was on top. This fixed the issue. Perhaps your buildpacks need to be ordered differently if you are using multiple.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 Ramandeep Singh
Solution 3 Abhishek Poojary
Solution 4 sebvargo
Solution 5
Solution 6 Zach Neill