ERPNext.com Frappe Cloud Documentation Partners Frappe School Public Chat

I am unable to start my bench - bind: Address already in use

administrator@Server:~/erpnext$ bench start
16:56:14 system | redis_socketio.1 started (pid=8172)
16:56:14 system | worker_long.1 started (pid=8174)
16:56:14 system | watch.1 started (pid=8176)
16:56:14 system | web.1 started (pid=8179)
16:56:14 system | redis_queue.1 started (pid=8177)
16:56:14 system | schedule.1 started (pid=8180)
16:56:14 redis_socketio.1 | 8184:M 29 Sep 16:56:14.894 * Increased maximum number of open files to 10032 (it was originally set to 1024).
16:56:14 system | worker_default.1 started (pid=8181)
16:56:14 system | socketio.1 started (pid=8187)
16:56:14 redis_socketio.1 | 8184:M 29 Sep 16:56:14.894 # Creating Server TCP listening socket 127.0.0.1:12000: bind: Address already in use
16:56:14 system | redis_socketio.1 stopped (rc=1)
16:56:14 redis_queue.1 | 8193:M 29 Sep 16:56:14.896 * Increased maximum number of open files to 10032 (it was originally set to 1024).
16:56:14 redis_queue.1 | 8193:M 29 Sep 16:56:14.896 # Creating Server TCP listening socket 127.0.0.1:11000: bind: Address already in use
16:56:14 system | redis_queue.1 stopped (rc=1)
16:56:14 system | redis_cache.1 started (pid=8186)
16:56:14 system | worker_short.1 started (pid=8190)
16:56:14 system | sending SIGTERM to worker_long.1 (pid 8174)
16:56:14 system | sending SIGTERM to watch.1 (pid 8176)
16:56:14 system | sending SIGTERM to web.1 (pid 8179)
16:56:14 system | sending SIGTERM to schedule.1 (pid 8180)
16:56:14 system | sending SIGTERM to worker_default.1 (pid 8181)
16:56:14 system | sending SIGTERM to socketio.1 (pid 8187)
16:56:14 system | sending SIGTERM to redis_cache.1 (pid 8186)
16:56:14 system | sending SIGTERM to worker_short.1 (pid 8190)
16:56:14 redis_cache.1 | 8202:signal-handler (1538220374) Received SIGTERM scheduling shutdown…
16:56:14 redis_cache.1 | 8202:M 29 Sep 16:56:14.900 * Increased maximum number of open files to 10032 (it was originally set to 1024).
16:56:14 system | worker_long.1 stopped (rc=-15)
16:56:14 system | worker_short.1 stopped (rc=-15)
16:56:14 system | web.1 stopped (rc=-15)
16:56:14 system | schedule.1 stopped (rc=-15)
16:56:14 system | watch.1 stopped (rc=-15)
16:56:14 redis_cache.1 | 8202:M 29 Sep 16:56:14.901 # Creating Server TCP listening socket 127.0.0.1:13000: bind: Address already in use
16:56:14 system | redis_cache.1 stopped (rc=-15)
16:56:14 system | worker_default.1 stopped (rc=-15)
16:56:14 system | socketio.1 stopped (rc=-15)
administrator@Server:~/erpnext$

pls help

You can see that your port is already in use.

  1. sudo supervisorctl stop all
  2. sudo service nginx stop
  3. bench start

not working same error

is there any other server working on Same port?

Make sure you tried all the command successfully.

administrator@Server:~/erpnext$ sudo supervisorctl stop all
unix:///var/run/supervisor.sock no such file
administrator@Server:~/erpnext$ sudo service nginx stop
administrator@Server:~/erpnext$ bench start
17:47:31 system | redis_socketio.1 started (pid=11568)
17:47:31 system | watch.1 started (pid=11572)
17:47:31 system | redis_queue.1 started (pid=11574)
17:47:31 system | web.1 started (pid=11575)
17:47:31 system | worker_long.1 started (pid=11570)
17:47:31 system | worker_default.1 started (pid=11577)
17:47:31 redis_socketio.1 | 11581:M 29 Sep 17:47:31.757 * Increased maximum number of open files to 10032 (it was originally set to 1024).
17:47:31 redis_socketio.1 | 11581:M 29 Sep 17:47:31.757 # Creating Server TCP listening socket 127.0.0.1:12000: bind: Address already in use
17:47:31 redis_queue.1 | 11584:M 29 Sep 17:47:31.758 * Increased maximum number of open files to 10032 (it was originally set to 1024).
17:47:31 system | redis_socketio.1 stopped (rc=1)
17:47:31 redis_queue.1 | 11584:M 29 Sep 17:47:31.758 # Creating Server TCP listening socket 127.0.0.1:11000: bind: Address already in use
17:47:31 system | socketio.1 started (pid=11579)
17:47:31 system | redis_queue.1 stopped (rc=1)
17:47:31 system | redis_cache.1 started (pid=11590)
17:47:31 system | schedule.1 started (pid=11576)
17:47:31 system | worker_short.1 started (pid=11591)

if not enable:
sudo systemctl enable supervisor

or

sudo service supervisor stop
sudo service supervisor start

Regarding your issue, 127.0.0.1:12000 and 127.0.0.1:11000 are already used, type sudo lsof -i -P -n | grep LISTEN to know the used IP addresses, and show the output then kill it manually, if nothing important is using it kill it so that supervisor uses that IP address
netstat -lnp | grep 'tcp .*IPADDRESS:PORT' | sed -e 's/.*LISTEN *//' -e 's#/.*##' | xargs kill this is not a very clean way, but it works

Rebooting the OS might work sometimes, because you will start fresh, but that’s a lazy solution, and you wouldn’t know what is the cause and how you solved the issue.

2 Likes

Thnx for your support

Solution that worked for me:

"sudo lsof -t -i tcp:12000 -s tcp:listen | sudo xargs kill"

Note: This command is used to kill any process running on the said port. Tip: Replace the port number with the one from the error

it works thanks