What is the reason for "Procfile declares types -> (none)" in Heroku?
I am trying to deploy a test app to Heroku --stack cedar but every time I do my Procfile is being ignored.
It should be saying this:
Procfile declares types -> web
But says this
Procfile declares types -> (none)
Because of this problem it of course won't load on the heroku platform when I navigate the URL.
Aside from this test (A) I have an IDENTICAL project (B) in another folder which DOES work. I am so utterly confused as to why (A) doesn't that I'm coming here to ask now.
A couple other things I've tried with (A) include:
- recreating the heroku app
- recreating th开发者_运维百科e git repo (i.e. delete .git, git init...)
- clearing out the files from the project folder, and copying the files from the other copy that works
If I make top-level folder copy of (B) then that copy will work. The issue seems to be copying files/folders from within (B) et al to within (A), the cursed one.
So, so far all I can determine is everything is working minus this (A) cursed folder. I would love to find out why instead of having to come to a witch-craft conclusion.
I had the same problem and I just now I found what was wrong. I first accidently called the file ProcFile
instead of Procfile
. Simply renaming that file did not get picked up by git. I had to do a git rm ProcFile -f
first and then add a new (correctly named) Procfile
. After that, it got pushed correctly by git and got picked up correctly by Heroku.
Make sure your Procfile does not have any extension.And if it has any you have to rename that file to Procfile without any extension and commit and check out the master
The space between the Record name and the contents seems to be important:
Use:
web: python manage.py runserver
and not
web:python manage.py runserver
Did you remember to commit your Procfile
to git? I've forgotten to do this commit, done a git push heroku master
, and seen the (none)
message stated above.
If you've forgotten, then commit your Procfile
and perform git push heroku master
again.
I had this error and tried all the solutions above but they did not work. Turns out that I had created the git repository in the root of the virtual environment. Which seems reckless but hey...
So if you have tried all the solutions and they don't work check where you created your repository and make sure it is in the root of your project source code and not anywhere else.
this problem is mainly caused by the create Procfile command when it is run from the command prompt or terminal. I recommend you to create the Procfile manually.
If you are using Visual Studio code then, click on the pipfile and then on the upper side click the create new file
button and enter the name of the file as Procfile
.
Before doing this delete previous Procfile and also use the command git rm procfile -f
in command prompt in your active virtual environment.
if you are using any other IDE then open notepad and enter this line in it
web: gunicorn mb_project.wsgi --log-file
-
after that save it as Procfile and put this file below your pipfile.
here is the link of my files https://github.com/YashMarmat/message-board-app.git
I'm adding to Pascal Lindelauf answer - make sure your file name is "Procfile" (with a capital P) and not "procfile" (that was the case with me just now) good luck!
I have sth to say about "Procfile declares types -> (none)" error.
One thing we should pay attention to is the hidden extension of "Procfile" file. I thought my command in "Procfile" was correct but I kept receiving this error. After half an hour I found that "Procfile" has the extension ".txt" but was hidden by the default setting of my macOS. After removing the extension, everything works fine!
I had this problem deploying a Django app to Heroku.
- the git repository has to be initialised in the Django project root folder (where
manage.py
lives) - this is also where the
Procfile
needs to sit
File structure:
Documents/
|---djangoprojectname/
| |---djangoprojectname/
| | |---__init__.py
| | |---settings.py
| | |---urls.py
| | |---wsgi.py
| |---djangoappname/
| |---.git
| |---manage.py
| |---Procfile
The Procfile
should look like this as per the docs:
web: gunicorn djangoprojectname.wsgi
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.
I was getting the same problem, and tried everything posted here. I was getting:
Procfile declares types -> (none)
Instead of Procfile declares types -> web. My fix was to change in the regedit to 0 (tutorial here https://www.thewindowsclub.com/show-file-extensions-in-windows) and then deleting the .txt in the end of Procfile (So It was just a file with no extension). After that my problem was solved! You can check if you have solved doing the following commands in the cmd:
heroku ps
Should display something like:
=== web (Free): gunicorn app:app (1)
Or the git push:
git push heroku master
And that should display:
Procfile declares types -> web
Make sure you don't give any extension to Procfile. I did and got similar error. Also check syntax. For e.g:
web : sh setup.sh should be
web: sh setup.sh
In my case I've got multi-module project. I've put Procfile in server module (which was the only module intended to be run on heroku) but Heroku searched for it in the root project directory (one level up).
I had to make sure that the Procfile was in the root folder of the project. I had accidentally created it inside the src
folder.
Initially created Procfile.txt using textpad and later renamed Procfile.
But this still opens in Texteditor and giving away error "Couldnt find that process type (web)"
Note : "Couldnt find that process type (web)" comes when ssytem cannot read your procfile
This aint windows/linux problem.
Instead of creating Procfile through text editors, use pyCharm-> create file->"Procfile"
TaDaaaa. that should do your work and now
精彩评论