./run No such file or directory

145 views
Skip to first unread message

Zak

unread,
Sep 30, 2012, 1:41:32 PM9/30/12
to pylons-...@googlegroups.com
I'm trying to run a Pyramid app with Heroku's Foreman (via the these instructions from the Pyramid docs). I've already used these lines to try creating run:

python setup.py develop
python runapp.py

But it keeps giving me this error when I try to foreman start:

zak$ sudo foreman start
12:27:59 web.1     | started with pid 1308
12:27:59 web.1     | /usr/local/foreman/bin/runner: line 36: /Users/MyProject/run: No such file or directory
12:27:59 web.1     | process terminated
12:27:59 system    | sending SIGTERM to all processes

this is the contents of my procfile:

web: ./run

I've already created a runapp.py. Why is it not able to located run?

Flack

unread,
Sep 30, 2012, 8:42:09 PM9/30/12
to pylons-...@googlegroups.com
I use the following template for running pyramid apps on heroku.

Zak

unread,
Sep 30, 2012, 9:58:28 PM9/30/12
to pylons-...@googlegroups.com
I'm pretty sure my runapp.py is correct...but for some reason, foreman is not detecting the run command. Do you know what determines the run command? What is that line from the procfile pointing to exactly?

Also a quick correction:

12:27:59 web.1     | /usr/local/foreman/bin/runner: line 36: /Users/zak/MyProject/run: No such file or directory

Flack

unread,
Sep 30, 2012, 10:03:53 PM9/30/12
to pylons-...@googlegroups.com
You should be calling your runapp.py.  run isn't supposed to be command.
eg. my proc file:
web: ./run.py

Whit Morriss

unread,
Oct 1, 2012, 11:16:11 AM10/1/12
to <pylons-discuss@googlegroups.com>

On Sep 30, 2012, at 12:41 PM, Zak <zakd...@gmail.com>
 wrote:
try this:

web: python runapp.py


iirc, it's looking for something on the path (and you have created runapp.py not a script called run)

-w

dougzor

unread,
Oct 1, 2012, 8:17:19 PM10/1/12
to pylons-...@googlegroups.com
Hey Zak,

I wrote the most updated version of those Heroku docs. Are you trying to run your stack locally or have it deploy successfully to Heroku? Generally I just use the standard "paster serve development.ini" or "pserve development.ini", etc. when testing locally.

Doug

Zak

unread,
Oct 4, 2012, 3:20:32 PM10/4/12
to pylons-...@googlegroups.com
Doug - 

I'm trying to run the stack locally with foreman. I'm not using "paster serve development.ini" because I'm using Gunicorn and it takes arguments that can't be set exclusively in an INI file. In the Pyramid tutorial for Heroku, the example says to create a procfile with the line "web: ./run" This is the source of my confusion. What is "run" exactly? How am I suppose to generate that command? web: python runapp.py seems to work because I do actually have a runapp.py in the app directory, but that is different than the example in the tutorial.

Zak

unread,
Oct 4, 2012, 3:21:34 PM10/4/12
to pylons-...@googlegroups.com, wh...@surveymonkey.com
Then why does the tutorial instruct a "web: ./run" procfile?

Zak

unread,
Oct 4, 2012, 3:22:42 PM10/4/12
to pylons-...@googlegroups.com
correction: "I'm not using "paster serve development.ini" because I'm using Gunicorn and it takes arguments that can't be set exclusively in an INI file to my knowledge"

dougzor

unread,
Oct 5, 2012, 5:04:54 PM10/5/12
to pylons-...@googlegroups.com
The "run" file is just an executable shell file (it's created in the step after creating the Procfile). You can create it by doing something like: "vim run" and then add the following lines to that file:
#!/bin/bash
python setup.py develop
python runapp.py

 After saving that file, run "chmod +x run" to make that file executable. I hope that helps!

P.S. I'm not an expert with gunicorn, so I'll yield to other's expertise on that.

Mark Huang

unread,
Oct 7, 2012, 4:45:52 AM10/7/12
to pylons-...@googlegroups.com
Hi Zak,

Like you, I also tried to use a run shell script when deploying my Pyramid aplication locally on my own server (not Heroku).   Maybe I can shed some light on the run script.  

The run script is just a shell script (in my case a BASH script) to run your pyramid app.  I also use Gunicorn.  In my project root directory I had a config.py file to store the gunicorn initialization variables.  It's something like:

import multiprocessing

workers = multiprocessing.cpu_count() * 2 +1
timeout = 60
daemon = True
pidfile = "/srv/web/run/test/test.pid"
errorlog = "/srv/web/log/test/test.log"

Then in my run script I have:

#!/bin/bash
gunicorn_paster --config=<path_to_config.py_file> /srv/web/prod/test/production.ini

I'm pretty sure this will be similar when used under Heroku.  

I hope this helps your use case.  

Regards,
Mark Huang
Reply all
Reply to author
Forward
0 new messages