27

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?

Cœur
  • 37,241
  • 25
  • 195
  • 267
Gerard22
  • 353
  • 2
  • 7
  • 14

7 Answers7

62

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!

Alon Gouldman
  • 3,025
  • 26
  • 29
9

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

Ramandeep Singh
  • 552
  • 6
  • 11
  • This worked for me but when I open the application I still have "Application error" and I also get "Disconnected from log stream. There may be events happening that you do not see here! Attempting to reconnect..." in my logs. Please help. Edit: Just realized I am on Linux so might be different – Joshua Jan 16 '20 at 21:57
6

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?

Abhishek Poojary
  • 749
  • 9
  • 10
5

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

sebvargo
  • 613
  • 7
  • 10
1

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.

Ieni Yuan
  • 11
  • 2
1

In My case the error was solved by just creating space between web and gunicorn

Before: web:gunicorn --pythonpath app app.wsgi

After: web: gunicorn --pythonpath app app.wsgi

0

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.