Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

why am i getting an error for heroku local web - f Procfile.windows ? #25

Open
netisheth opened this issue Jul 26, 2016 · 10 comments
Open

Comments

@netisheth
Copy link

netisheth commented Jul 26, 2016

Hi, I am new to Heroku and I just started with their first tutorial Getting Started on Heroku with Java. I could implement all the steps successfully but i can't run the app locally. The build was successful.

C:\Users\my\Documents\GitHub\java-getting-started [master ≡]> heroku local web -
f Procfile.windows

[OKAY] Loaded ENV .env File as KEY=VALUE Format
[WARN] ENOENT: no such file or directory, open 'C:\Users\my\Documents\GitHub\jav
a-getting-started\Procfile.windows'
[FAIL] No Procfile and no package.json file found in Current Directory - See her
oku local --help

Can someone please help me with it?
Thank you in advance.

@jdx
Copy link
Contributor

jdx commented Jul 26, 2016

does the Procfile exist in that location?

@netisheth
Copy link
Author

Yes it's there.

@jdx
Copy link
Contributor

jdx commented Jul 26, 2016

heroku local is just a wrapper for node-foreman: https://github.com/strongloop/node-foreman

maybe see if you can use node-foreman directly to rule out whether or not this is an issue with heroku local.

@wparrkerr
Copy link

I was experiencing a very similar error while trying to deploy my first app, which is written in python using the Flask framework.

I got the same failure message upon running heroku local, although I had a different [WARN] message(these warnings are just warnings though and aren't crashing heroku local):

[FAIL] No Procfile and no package.json file found in Current Directory - See her
oku local --help

It turns out that I had incorrect syntax in my Procfile, and instead of saying the syntax in the Procfile was wrong, the error was just saying it can't find a procfile at all.

Specifics, in case they help

the command I run my app with is:
gunicorn app:app

My Incorrect Procfile was:
web gunicorn app:app

I was missing a colon after 'web', as the syntax is <process type>:<command>. Changing the Procfile fixed the problem:
web: gunicorn app:app

Your situation is probably different. I would say just ensure your Procfile syntax is spot on, because apparently heroku local won't recognize the Procfile even exists if the syntax is incorrect.

@grantathon
Copy link

I did this and I still get the error. I've been trying to figure this out all day, but nothing. If I run "heroku local", it complains with the "[FAIL] No Procfile and no package.json file found in Current Directory - See run.js --help" error. If I run "heroku local web", it complains with this:

return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
^

Error: EACCES: permission denied, open '.env'
at Object.fs.openSync (fs.js:584:18)
at Object.fs.readFileSync (fs.js:491:33)
at loadEnvsFile (/snap/heroku/414/lib/node_modules/heroku-cli/node_modules/foreman/lib/envs.js:133:15)
at Array.map (native)
at loadEnvs (/snap/heroku/414/lib/node_modules/heroku-cli/node_modules/foreman/lib/envs.js:148:30)
at Command. (/snap/heroku/414/lib/node_modules/heroku-cli/node_modules/foreman/nf.js:72:16)
at Command.listener (/snap/heroku/414/lib/node_modules/heroku-cli/node_modules/commander/index.js:301:8)
at emitTwo (events.js:106:13)
at Command.emit (events.js:194:7)
at Command.parseArgs (/snap/heroku/414/lib/node_modules/heroku-cli/node_modules/commander/index.js:615:12)

Please help!

@jdx
Copy link
Contributor

jdx commented Jul 13, 2017

you're probably not in the right directory

@grantathon
Copy link

I have it in the same directory level as the project and app directories where manage.py is located, which I believe is correct.

@grantathon
Copy link

I've confirmed the same thing happens with the original heroku django template found here: https://github.com/heroku/heroku-django-template.

@WojciechThomas
Copy link

You have not built your application locally and that is the reason you receive an error: there is no app startup script called from Procfile.windows.

To resolve the problem just run:
sbt compile stage
and voila... now you can run your app locally.

@marokac
Copy link

marokac commented Feb 16, 2018

i made a java rest api and is hosted nicely on heroku but some of the services says application error and also slow what could be the problem

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants