port is not a valid number #112

Closed
zemanel opened this Issue Dec 28, 2011 · 9 comments

Projects

None yet

5 participants

@zemanel
zemanel commented Dec 28, 2011

Hi,

i'm using foreman 0.30.1, to manage a Django project's processes (gunicorn), with the following Procfile entry:

web: python project/manage.py run_gunicorn -b "0.0.0.0:$PORT" -w 3

and (i believe it may be since i upgraded foreman recently), due to the double quotes around the -b (bind), i get the following error message on the logs and the processes exit:

20:30:08 web.1     | Error: '8000"' is not a valid port number.

running the usual "foreman start -p 8000" (not specifying the port results in the same error, only with the default 5000 port).

If i remove the double quotes on the -b parameter it works fine.

Could this be a bug with foreman ?

@zemanel
zemanel commented Jan 3, 2012

Note: reverted to foreman gem "0.26.1" and the issue does not occur

@ddollar
Owner
ddollar commented Jan 23, 2012

Does this happen on the latest foreman?

@zemanel
zemanel commented Jan 23, 2012

Yep. Reverted to older version and wasnt reproducible
No dia 23 de Jan de 2012 03:01, "David Dollar" <
reply@reply.github.com>
escreveu:

Does this happen on the latest foreman?


Reply to this email directly or view it on GitHub:
#112 (comment)

@mwarkentin

I had this same issue:

mwarkentin@Michaels-iMac come-together (master) $ foreman start
08:37:15 web.1     | started with pid 1215
08:37:16 web.1     | 
08:37:16 web.1     | Error: '5000"' is not a valid port number.
08:37:16 web.1     | 
08:37:16 web.1     | Validating models...
08:37:16 web.1     | 0 errors found
08:37:16 web.1     | 
08:37:16 web.1     | Django version 1.3.1, using settings 'come-together.settings'
08:37:16 web.1     | Server is running
08:37:16 web.1     | Quit the server with CONTROL-C.
08:37:16 web.1     | process terminated
08:37:16 system    | sending SIGTERM to all processes

After reverting to 0.26.1 as per @zemanel :

mwarkentin@Michaels-iMac come-together (master) $ foreman start
08:43:44 web.1     | started with pid 1391
08:43:45 web.1     | Validating models...
08:43:45 web.1     | 0 errors found
08:43:45 web.1     | 
08:43:45 web.1     | Django version 1.3.1, using settings 'come-together.settings'
08:43:45 web.1     | Server is running
08:43:45 web.1     | Quit the server with CONTROL-C.
08:43:45 web.1     | 2012-02-17 08:43:45 [1392] [INFO] Starting gunicorn 0.13.4
08:43:45 web.1     | 2012-02-17 08:43:45 [1392] [INFO] Listening at: http://0.0.0.0:5000 (1392)
08:43:45 web.1     | 2012-02-17 08:43:45 [1392] [INFO] Using worker: sync
08:43:45 web.1     | 2012-02-17 08:43:45 [1393] [INFO] Booting worker with pid: 1393
08:43:45 web.1     | 2012-02-17 08:43:45 [1394] [INFO] Booting worker with pid: 1394
08:43:45 web.1     | 2012-02-17 08:43:45 [1395] [INFO] Booting worker with pid: 1395
@repustate

Can also confirm this happens with the most recent version of foreman, I just remove the quotes (not sure why they need to be there anyway?) and things work fine.

@mwarkentin

@mostrovsky You remove which quotes.. the ones from the Procfile definition?

Like this: web: python project/manage.py run_gunicorn -b 0.0.0.0:$PORT -w 3

@repustate

Yes, remove those quotes as you did above.

@mwarkentin

@mostrovsky Thanks, that worked great. :)

@zeke
zeke commented Aug 19, 2012

Not sure if this is the same issue, but in order to get foreman to play nicely when hosting a simple node.js app using socket.io (without express), I had to cast the port as a number:

// works with `node web.js` but not `foreman start`
var port = process.env.PORT || 5000;

// Works with both
var port = Number(process.env.PORT) || 5000;
@ddollar ddollar closed this Apr 23, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment