unable to parse Procfile
Asked Answered
S

7

17

I am trying to deploy an Heroku app.

I must be doing something wrong with the Procfile. When I run foreman check I get this error.

ERROR: no processes defined

I get pretty much the same thing when deploying on Heroku

-----> Building runtime environment
-----> Discovering process types

 !     Push failed: cannot parse Procfile.

The Procfile looks like this

web: node app.js

What did I miss?


update I re-did all from the start, It works properly now. I think I might have issue with Unix line ending

Sebi answered 7/11, 2013 at 20:46 Comment(0)
S
3

Is your Procfile in the root of your project? Is it spelled with a capital P? Does it have unix line endings?

Snicker answered 8/11, 2013 at 17:12 Comment(1)
Yes it's in the root. it's correctly spelled, and git track the correct spelling. I think I will got with the unix line endings because I am on windows.Sebi
P
19

Just encounter "Push failed: cannot parse Procfile." on Windows. I can conclude that It IS "Windows-file format" problem, NOT the context of file itself.

make sure to create a clean file, maybe use Notepad++ or other advanced editor to check the file type.

Pettifer answered 16/12, 2013 at 5:21 Comment(1)
Thank you! I was going crazy trying to figure this out. I re-created the file in Notepad++ and that solved the issue!Kajdan
G
10

save as a utf-8 character file, rather than what it is - a utf 16 character file. this is a confirmed fix.

Graphology answered 21/12, 2019 at 12:3 Comment(1)
this one was the one helping me, the other top comment didn''t explain what kind of file character should we usedCrosier
S
8

Open your current Procfile with notepad. Create a new Procfile.txt and paste the content of your original Procfile . Save your Procfile and replace it with your new Procfile

Softy answered 5/2, 2017 at 10:8 Comment(1)
This fixed it for me on Windows 10 PowerShellJillianjillie
A
6

I had the same issue, using VSCode I changed file to UTF-8 (bottom right), saved file and pushed it - and it was successful.

Araucania answered 7/9, 2021 at 20:49 Comment(0)
S
3

Is your Procfile in the root of your project? Is it spelled with a capital P? Does it have unix line endings?

Snicker answered 8/11, 2013 at 17:12 Comment(1)
Yes it's in the root. it's correctly spelled, and git track the correct spelling. I think I will got with the unix line endings because I am on windows.Sebi
S
2

It is happening due to a different encoding type in your Procfile.

  1. Open your Procfile in a text editor, preferably, Notepad.
  2. Save the file and in the encoding option, change the encoding to UTF-8 (default is UTF-16).
  3. Replace your current Procfile with this file in the root folder of your project and remove the .txt extension.

Push your code again and you'll be good to go!

Sliwa answered 15/6, 2021 at 9:33 Comment(0)
J
0

Create Procfile using the following command,

echo web: gunicorn app:app > Procfile
Jugglery answered 7/9, 2022 at 15:47 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.