Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Heroku Foreman errors on 0.0.0.0:5000

I am trying to debug this issue using Heroku's Foreman app. My issue is that Foreman is trying to run the process on port 5000 and at ip address 0.0.0.0. It says there is something using the port but I am not sure how to figure that out as I have nothing else running. I tried running 'netstat -lnt | grep 5000' with nothing.

> foreman start
11:16:45 web.1  | started with pid 17758
11:16:46 web.1  | 2013-12-31 11:16:46 [17758] [INFO] Starting gunicorn 18.0
11:16:46 web.1  | 2013-12-31 11:16:46 [17758] [ERROR] Connection in use: ('0.0.0.0', 5000)
11:16:46 web.1  | 2013-12-31 11:16:46 [17758] [ERROR] Retrying in 1 second.
11:16:47 web.1  | 2013-12-31 11:16:47 [17758] [ERROR] Connection in use: ('0.0.0.0', 5000)
11:16:47 web.1  | 2013-12-31 11:16:47 [17758] [ERROR] Retrying in 1 second.

I run the gunicorn command by it's self and it works fine (so I was able to eliminate that as an issue):

> gunicorn hellodjango.wsgi
2013-12-31 11:25:33 [17853] [INFO] Starting gunicorn 18.0
2013-12-31 11:25:33 [17853] [INFO] Listening at: http://127.0.0.1:8000 (17853)
2013-12-31 11:25:33 [17853] [INFO] Using worker: sync
2013-12-31 11:25:33 [17856] [INFO] Booting worker with pid: 17856

I am running this on my Mac (10.8).

Any insight on how to figure this out would be greatly appreciated.

-rb


Upon further investigation, I discovered that 0.0.0.0:5000 is used by Bonjour, Apple's network discovery app. Looking into how to change the port for Foreman next.

like image 564
renderbox Avatar asked Dec 16 '22 02:12

renderbox


1 Answers

Figured this all out.

Solve is to manually set the port in the env and run foreman that way.

export PORT=5001

then

> foreman start
13:22:23 web.1  | started with pid 18194
13:22:24 web.1  | 2013-12-31 13:22:24 [18194] [INFO] Starting gunicorn 18.0
13:22:24 web.1  | 2013-12-31 13:22:24 [18194] [INFO] Listening at: http://0.0.0.0:5001 (18194)
13:22:24 web.1  | 2013-12-31 13:22:24 [18194] [INFO] Using worker: sync
13:22:24 web.1  | 2013-12-31 13:22:24 [18197] [INFO] Booting worker with pid: 18197

I imagine this will be an issue for everyone on OSX and hopefully this will save some headaches.

-rb

like image 66
renderbox Avatar answered Jan 14 '23 17:01

renderbox