Bench start error on production

Kindly find the error attached when starting bench on production in ubuntu 16.04:

23:28:47 system | redis_socketio.1 started (pid=2289)
23:28:47 system | worker_long.1 started (pid=2295)
23:28:47 system | watch.1 started (pid=2300)
23:28:47 redis_socketio.1 | 2299:M 07 Nov 23:28:47.637 * Increased maximum number of open files to 10032 (it was originally set to 1024).
23:28:47 redis_socketio.1 | 2299:M 07 Nov 23:28:47.637 # Creating Server TCP listening socket 127.0.0.1:12000: bind: Address already in use
23:28:47 system | redis_socketio.1 stopped (rc=1)
23:28:47 system | redis_queue.1 started (pid=2301)
23:28:47 redis_queue.1 | 2305:M 07 Nov 23:28:47.637 * Increased maximum number of open files to 10032 (it was originally set to 1024).
23:28:47 redis_queue.1 | 2305:M 07 Nov 23:28:47.637 # Creating Server TCP listening socket 127.0.0.1:11000: bind: Address already in use
23:28:47 system | redis_queue.1 stopped (rc=1)
23:28:47 system | web.1 started (pid=2307)
23:28:47 system | schedule.1 started (pid=2311)
23:28:47 system | worker_default.1 started (pid=2309)
23:28:47 system | socketio.1 started (pid=2312)
23:28:47 system | redis_cache.1 started (pid=2314)
23:28:47 redis_cache.1 | 2320:M 07 Nov 23:28:47.682 * Increased maximum number of open files to 10032 (it was originally set to 1024).
23:28:47 redis_cache.1 | 2320:M 07 Nov 23:28:47.682 # Creating Server TCP listening socket 127.0.0.1:13000: bind: Address already in use
23:28:47 system | redis_cache.1 stopped (rc=1)
23:28:47 system | worker_short.1 started (pid=2313)
23:28:47 system | sending SIGTERM to worker_long.1 (pid 2295)
23:28:47 system | sending SIGTERM to watch.1 (pid 2300)
23:28:47 system | sending SIGTERM to web.1 (pid 2307)
23:28:47 system | sending SIGTERM to schedule.1 (pid 2311)
23:28:47 system | sending SIGTERM to worker_default.1 (pid 2309)
23:28:47 system | sending SIGTERM to socketio.1 (pid 2312)
23:28:47 system | sending SIGTERM to worker_short.1 (pid 2313)
23:28:47 system | worker_long.1 stopped (rc=-15)
23:28:47 system | watch.1 stopped (rc=-15)
23:28:47 system | schedule.1 stopped (rc=-15)
23:28:47 system | socketio.1 stopped (rc=-15)
23:28:47 system | worker_default.1 stopped (rc=-15)
23:28:47 system | web.1 stopped (rc=-15)
23:28:47 system | worker_short.1 stopped (rc=-15)

I have just posted a possible solution here:

when i do grep command, i see this:

frappe 3844 0.0 0.1 40136 5908 ? Sl 03:41 0:00 /usr/bin/redis-server 127.0.0.1:13000
frappe 3849 0.0 0.1 40136 5840 ? Sl 03:41 0:00 /usr/bin/redis-server 127.0.0.1:12000
redis 3890 0.1 0.1 40136 6692 ? Ssl 03:42 0:00 /usr/bin/redis-server 127.0.0.1:6379
frappe 4144 0.0 0.1 40136 5960 ? Sl 03:46 0:00 /usr/bin/redis-server 127.0.0.1:11000
erpnext 4366 0.0 0.0 14224 964 pts/0 S+ 03:48 0:00 grep --color=auto redis

i tried to kill the process 3890 but it still run if i do the grep command immediately.

Is this maybe an issue of how i setup the production environment using the easy install? just speculating.

Try the command:
sudo supervisorctl restart all
which will restart redis and other services.

You should get an output like:
frappe-bench-frappe-schedule: stopped
frappe-bench-frappe-default-worker-0: stopped
frappe-bench-frappe-long-worker-0: stopped
frappe-bench-frappe-short-worker-0: stopped
frappe-bench-frappe-web: stopped
frappe-bench-node-socketio: stopped
frappe-bench-redis-queue: stopped
frappe-bench-redis-cache: stopped
frappe-bench-redis-socketio: stopped
frappe-bench-frappe-schedule: started
frappe-bench-frappe-default-worker-0: started
frappe-bench-frappe-long-worker-0: started
frappe-bench-frappe-short-worker-0: started
frappe-bench-frappe-web: started
frappe-bench-node-socketio: started
frappe-bench-redis-queue: started
frappe-bench-redis-cache: started
frappe-bench-redis-socketio: started

@webingold2 answer is correct but to elaborate when in production mode you don’t use bench start you use sudo supervisorctl restart all as mentioned above.
I normally do this:
sudo service nginx restart
sudo supervisorctl restart all
HTH

Tried the command but still its not working. I reinstalled the app afresh and the application started okay on port 80 but after some time it failed to load and the app cannot start anymore. was just looking at some error log here. Any more pointers where i can look for

echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

Try this command

1 Like