Error while Setup production server

Hello all,

I am facing an error whilw setup production servor.while i am running the following command

sudo service supervisor restart

I get the following error.

Restarting supervisor: Error: .ini file does not include supervisord section
For help, use /usr/bin/supervisord -h

Anyone know how to fix this?

Thanks

In production environment it will be started automatically

@Sathams_Tech_TV Thanks for the reply. In browser its showing like this…how to fix this…?

Try to run this command and check

sudo supervisorctl restart gunicorn

1 Like

@Sathams_Tech_TV while running this command sudo supervisorctl restart gunicorn it is showing
gunicorn: ERROR (no such process)
gunicorn: ERROR (no such process)

what do you get when run these two - for eg. these are healthy

frappe@ubuntu:~/frappe-bench$ sudo supervisorctl status
frappe-bench-redis:frappe-bench-redis-cache RUNNING pid 8752, uptime 0:00:55
frappe-bench-redis:frappe-bench-redis-queue RUNNING pid 8751, uptime 0:00:56
frappe-bench-redis:frappe-bench-redis-socketio RUNNING pid 8753, uptime 0:00:55
frappe-bench-web:frappe-bench-frappe-web RUNNING pid 8700, uptime 0:01:09
frappe-bench-web:frappe-bench-node-socketio RUNNING pid 8771, uptime 0:00:54
frappe-bench-workers:frappe-bench-frappe-default-worker-0 RUNNING pid 8701, uptime 0:01:09
frappe-bench-workers:frappe-bench-frappe-long-worker-0 RUNNING pid 8702, uptime 0:01:09
frappe-bench-workers:frappe-bench-frappe-schedule RUNNING pid 8704, uptime 0:01:08
frappe-bench-workers:frappe-bench-frappe-short-worker-0 RUNNING pid 8703, uptime 0:01:09
frappe@ubuntu:~/frappe-bench$
frappe@ubuntu:~/frappe-bench$
frappe@ubuntu:~/frappe-bench$
frappe@ubuntu:~/frappe-bench$ netstat -tlnp
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN -
tcp 0 0 127.0.0.1:11000 0.0.0.0:* LISTEN 8751/redis-server 1
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN -
tcp 0 0 127.0.0.1:8000 0.0.0.0:* LISTEN 8700/python
tcp 0 0 127.0.0.1:12000 0.0.0.0:* LISTEN 8753/redis-server 1
tcp 0 0 127.0.0.1:13000 0.0.0.0:* LISTEN 8752/redis-server 1
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN -
tcp 0 0 127.0.0.1:6379 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:53 0.0.0.0:* LISTEN -
tcp6 0 0 :::22 :::* LISTEN -
tcp6 0 0 :::25 :::* LISTEN -
tcp6 0 0 :::9000 :::* LISTEN 8771/node
tcp6 0 0 :::53 :::* LISTEN

1 Like

This may help [solved] production server - redis spawn error

@clarkej while running this command sudo supervisorctl status nothing is seeing

@clarkej while running netstat -tlnp this command i get

(No info could be read for “-p”: geteuid()=1000 but you should be root.)
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN -
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:8001 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:8002 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:8003 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:8004 0.0.0.0:* LISTEN -
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN -
tcp 0 0 127.0.0.1:6379 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN -
tcp6 0 0 :::22 :::* LISTEN -

while running this command sudo supervisorctl status nothing is seeing

ok so your config is broken.

You can reinstall, or you could run this

bench setup production frappe

that will likely require further troubleshooting.

If you have a working system you can compare that with your broken one?

@clarkej thanks for the reply but when i run bench setup production frappe its showing

nginx.conf already exists and this will overwrite it. Do you want to continue? [y/N]: y
Traceback (most recent call last):
File “/usr/local/bin/bench”, line 9, in
load_entry_point(‘bench==4.1.0’, ‘console_scripts’, ‘bench’)()
File “/home/erpnext/frappe-progress/bench-repo/bench/cli.py”, line 40, in cli
bench_command()
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 722, in call
return self.main(*args, **kwargs)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 697, in main
rv = self.invoke(ctx)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 535, in invoke
return callback(*args, **kwargs)
File “/home/erpnext/frappe-progress/bench-repo/bench/commands/setup.py”, line 56, in setup_production
setup_production(user=user)
File “/home/erpnext/frappe-progress/bench-repo/bench/config/production_setup.py”, line 9, in setup_production
fix_prod_setup_perms(bench_path, frappe_user=user)
File “/home/erpnext/frappe-progress/bench-repo/bench/utils.py”, line 464, in fix_prod_setup_perms
uid = pwd.getpwnam(frappe_user).pw_uid
KeyError: ‘getpwnam(): name not found: frappe’

ok frappe is not recognized, so substitute here the user account you chose in your case.

@clarkej ok… when i run bench setup production erpnext it shows

supervisor.conf already exists and this will overwrite it. Do you want to continue? [y/N]: y
Port configuration list:
Site new.abc assigned port: 80

Site site.abc assigned port: 8001

Site abc.site assigned port: 8002

Site dev.site.abc assigned port: 8003

Site new.site.local assigned port: 8004
nginx.conf already exists and this will overwrite it. Do you want to continue? [y/N]: y
Error: .ini file does not include supervisorctl section
For help, use /usr/bin/supervisorctl -h
Error: .ini file does not include supervisorctl section
For help, use /usr/bin/supervisorctl -h
supervisord: unrecognized service
Restarting supervisor: Error: .ini file does not include supervisord section
For help, use /usr/bin/supervisord -h
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

  • Reloading nginx configuration nginx [ OK ]

ok so you should check your /etc/supervisor/supervisord.conf for the two missing sections.

One option I strongly suggest is to run a fresh install, good value for learning but then you will have a working instance for reference to troubleshoot any broken instances.

Also to avoid issues be sure to run install with sudo from non-root user account.

@clarkej when i checked the file /etc/supervisor/supervisord.conf The supervisord.conf contains following data

; Notes:
; priority=1 --> Lower priorities indicate programs that start first and shut down last
; killasgroup=true --> send kill signal to child processes too
[program:frappe-bench-frappe-web]
command=/home/erpnext/frappe-abc/frappe-bench/env/bin/gunicorn -b 127.0.0.1:8000 -w 4 -t 120 frappe.app:application --preload
priority=4
autostart=true
autorestart=true
stdout_logfile=/home/erpnext/frappe-abc/frappe-bench/logs/web.log
stderr_logfile=/home/erpnext/frappe-abc/frappe-bench/logs/web.error.log
user=erpnext
directory=/home/erpnext/frappe-abc/frappe-bench/sites

[program:frappe-bench-frappe-schedule]
command=/usr/local/bin/bench schedule
priority=3
autostart=true
autorestart=true
stdout_logfile=/home/erpnext/frappe-abc/frappe-bench/logs/schedule.log
stderr_logfile=/home/erpnext/frappe-abc/frappe-bench/logs/schedule.error.log
user=erpnext
directory=/home/erpnext/frappe-abc/frappe-bench

[program:frappe-bench-frappe-default-worker]
command=/usr/local/bin/bench worker --queue default
priority=4
autostart=true
autorestart=true
stdout_logfile=/home/erpnext/frappe-abc/frappe-bench/logs/worker.log
stderr_logfile=/home/erpnext/frappe-abc/frappe-bench/logs/worker.error.log
user=erpnext
stopwaitsecs=1560
directory=/home/erpnext/frappe-abc/frappe-bench
killasgroup=true
numprocs=1
process_name=%(program_name)s-%(process_num)d

[program:frappe-bench-frappe-short-worker]
command=/usr/local/bin/bench worker --queue short
priority=4
autostart=true
autorestart=true
stdout_logfile=/home/erpnext/frappe-abc/frappe-bench/logs/worker.log
stderr_logfile=/home/erpnext/frappe-abc/frappe-bench/logs/worker.error.log
user=erpnext
stopwaitsecs=360
directory=/home/erpnext/frappe-abc/frappe-bench
killasgroup=true
numprocs=1
process_name=%(program_name)s-%(process_num)d

[program:frappe-bench-frappe-long-worker]
command=/usr/local/bin/bench worker --queue long
priority=4
autostart=true
autorestart=true
stdout_logfile=/home/erpnext/frappe-abc/frappe-bench/logs/worker.log
stderr_logfile=/home/erpnext/frappe-abc/frappe-bench/logs/worker.error.log
user=erpnext
stopwaitsecs=1560
directory=/home/erpnext/frappe-abc/frappe-bench
killasgroup=true
numprocs=1
process_name=%(program_name)s-%(process_num)d

[program:frappe-bench-redis-cache]
command=/usr/bin/redis-server /home/erpnext/frappe-abc/frappe-bench/config/redis_cache.conf
priority=1
autostart=true
autorestart=true
stdout_logfile=/home/erpnext/frappe-abc/frappe-bench/logs/redis-cache.log
stderr_logfile=/home/erpnext/frappe-abc/frappe-bench/logs/redis-cache.error.log
user=erpnext
directory=/home/erpnext/frappe-abc/frappe-bench/sites

[program:frappe-bench-redis-queue]
command=/usr/bin/redis-server /home/erpnext/frappe-abc/frappe-bench/config/redis_queue.conf
priority=1
autostart=true
autorestart=true
stdout_logfile=/home/erpnext/frappe-abc/frappe-bench/logs/redis-queue.log
stderr_logfile=/home/erpnext/frappe-abc/frappe-bench/logs/redis-queue.error.log
user=erpnext
directory=/home/erpnext/frappe-abc/frappe-bench/sites

[program:frappe-bench-redis-socketio]
command=/usr/bin/redis-server /home/erpnext/frappe-abc/frappe-bench/config/redis_socketio.conf
priority=1
autostart=true
autorestart=true
stdout_logfile=/home/erpnext/frappe-abc/frappe-bench/logs/redis-socketio.log
stderr_logfile=/home/erpnext/frappe-abc/frappe-bench/logs/redis-socketio.error.log
user=erpnext
directory=/home/erpnext/frappe-abc/frappe-bench/sites

[program:frappe-bench-node-socketio]
command=/usr/bin/node /home/erpnext/frappe-abc/frappe-bench/apps/frappe/socketio.js
priority=4
autostart=true
autorestart=true
stdout_logfile=/home/erpnext/frappe-abc/frappe-bench/logs/node-socketio.log
stderr_logfile=/home/erpnext/frappe-abc/frappe-bench/logs/node-socketio.error.log
user=erpnext
directory=/home/erpnext/frappe-abc/frappe-bench

[group:frappe-bench-web]
programs=frappe-bench-frappe-web,frappe-bench-node-socketio

[group:frappe-bench-workers]
programs=frappe-bench-frappe-schedule,frappe-bench-frappe-default-worker,frappe-bench-frappe-short-worker,frappe-bench-frappe-long-worker

[group:frappe-bench-redis]
programs=frappe-bench-redis-cache,frappe-bench-redis-queue,frappe-bench-redis-socketio

ok yes as your error notice states that file has no [supervisord] and [supervisorctl] sections

This may give you ideas to troubleshoot [solution] 'supervisorctl start all' has no response or affect

@clarkej I have done that all but when i run this sudo supervisorctl status in terminal no status is showing

@vivin_joseph

Let’s try this:

“Have identified the issue, and working on a fix. In the meantime, use

sudo systemctl restart supervisor
before running

bench update”

Based on this:

Thanks for this @krnkris.

vivin_joseph also check for this, that your config may be missing:

frappe@eggplant:/etc/supervisor/conf.d$ ls -al
total 8
drwxr-xr-x 2 root root 4096 Mar 22 01:11 .
drwxr-xr-x 3 root root 4096 Mar 22 00:49 …
lrwxrwxrwx 1 root root 48 Mar 22 01:11 frappe-bench -> /home/frappe/frappe-bench/config/supervisor.conf

If it’s missing you can restore it with this
frappe@eggplant:/etc/supervisor/conf.d$ sudo ln -s ~/frappe-bench/config/supervisor.conf frappe-bench

@krnkris Thanks for the help but when i run sudo systemctl restart supervisor it shows the following.

sudo: systemctl: command not found