Error while Setup production server

@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:

https://github.com/frappe/erpnext/issues/13313

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

@krnkris its showing same error.

sudo: systemctrl: command not found

@clarkej I have checked all my config. All config are there.

@vivin_joseph

Sry I was wrong.

What is you operating system?

Check if systemd package installed:

sudo dpkg -l | grep systemd

@krnkris its ubuntu 16.04

@vivin_joseph

Please tell the outcom of this check:

Check if systemd package installed:

sudo dpkg -l | grep systemd

sudo dpkg -l | grep systemd

@krnkris when i run the comand its showing

ii libpam-systemd:amd64 229-4ubuntu16 amd64 system and service manager - PAM module
ii libsystemd0:amd64 229-4ubuntu16 amd64 systemd utility library
ii libsystemd0:i386 229-4ubuntu16 i386 systemd utility library
ii python3-systemd 231-2build1 amd64 Python 3 bindings for systemd
ii systemd 229-4ubuntu16 amd64 system and service manager
ii systemd-shim 9-1bzr4ubuntu1 amd64 shim for systemd
ii systemd-sysv 229-4ubuntu16 amd64 system and service manager - SysV links

@vivin_joseph

It seem to be OK, but may be corrupted.

Try to reinstall:

sudo apt-get reinstall systemd

Then update UBUNTU:
suso apt-get update
sudo apt-get upgrade

Then try again:

systemctl restart supervisor

@krnkris is this ok now

ii libpam-systemd:amd64 204-5ubuntu20.26 amd64 system and service manager - PAM module
ii libsystemd-daemon0:amd64 204-5ubuntu20.26 amd64 systemd utility library
ii libsystemd-login0:amd64 204-5ubuntu20.26 amd64 systemd login utility library
ii systemd-services 204-5ubuntu20.26 amd64 systemd runtime services
ii systemd-shim 6-2bzr1 amd64 shim for systemd

@vivin_joseph

It should be version 21.2 on UBUNTU 16.04:
ii libpam-systemd:amd64 229-4ubuntu21.2 amd64 system and service manager - PAM module
ii libsystemd0:amd64 229-4ubuntu21.2 amd64 systemd utility library
ii python3-systemd 231-2build1 amd64 Python 3 bindings for systemd
ii systemd 229-4ubuntu21.2 amd64 system and service manager
ii systemd-sysv 229-4ubuntu21.2 amd64 system and service manager - SysV links

Please run:
suso apt-get update
sudo apt-get upgrade

Then try again:

systemctl restart supervisor

@vivin_joseph

How you mean is OK now? :face_with_raised_eyebrow:

Are you solved it?