Bench restart - error sub process

bench restart
$ sudo supervisorctl restart frappe:
frappe: ERROR (no such group)
frappe: ERROR (no such group)
ERROR:
subprocess.CalledProcessError: Command ‘sudo supervisorctl restart frappe:’ returned non-zero exit status 2.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File “/usr/local/bin/bench”, line 8, in
sys.exit(cli())
File “/usr/local/lib/python3.10/dist-packages/bench/cli.py”, line 127, in cli
bench_command()
File “/usr/lib/python3/dist-packages/click/core.py”, line 1128, in call
return self.main(*args, **kwargs)
File “/usr/lib/python3/dist-packages/click/core.py”, line 1053, in main
rv = self.invoke(ctx)
File “/usr/lib/python3/dist-packages/click/core.py”, line 1659, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/lib/python3/dist-packages/click/core.py”, line 1395, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/usr/lib/python3/dist-packages/click/core.py”, line 754, in invoke
return __callback(*args, **kwargs)
File “/usr/local/lib/python3.10/dist-packages/bench/commands/utils.py”, line 41, in restart
Bench(“.”).reload(web, supervisor, systemd)
File “/usr/local/lib/python3.10/dist-packages/bench/utils/render.py”, line 126, in wrapper_fn
return fn(*args, **kwargs)
File “/usr/local/lib/python3.10/dist-packages/bench/bench.py”, line 151, in reload
restart_supervisor_processes(bench_path=self.name, web_workers=web, _raise=_raise)
File “/usr/local/lib/python3.10/dist-packages/bench/utils/bench.py”, line 321, in restart_supervisor_processes
failure = bench.run(f"{sudo}supervisorctl restart {group}", _raise=_raise)
File “/usr/local/lib/python3.10/dist-packages/bench/bench.py”, line 48, in run
return exec_cmd(cmd, cwd=cwd or self.cwd, _raise=_raise)
File “/usr/local/lib/python3.10/dist-packages/bench/utils/init.py”, line 158, in exec_cmd
raise CommandFailedError from subprocess.CalledProcessError(return_code, cmd)
bench.exceptions.CommandFailedError

bench setup supervisor
ERROR: Command ‘supervisorctl status’ returned non-zero exit status 1.
Traceback (most recent call last):
File “/usr/local/bin/bench”, line 8, in
sys.exit(cli())
File “/usr/local/lib/python3.10/dist-packages/bench/cli.py”, line 127, in cli
bench_command()
File “/usr/lib/python3/dist-packages/click/core.py”, line 1128, in call
return self.main(*args, **kwargs)
File “/usr/lib/python3/dist-packages/click/core.py”, line 1053, in main
rv = self.invoke(ctx)
File “/usr/lib/python3/dist-packages/click/core.py”, line 1659, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/lib/python3/dist-packages/click/core.py”, line 1659, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/lib/python3/dist-packages/click/core.py”, line 1395, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/usr/lib/python3/dist-packages/click/core.py”, line 754, in invoke
return __callback(*args, **kwargs)
File “/usr/local/lib/python3.10/dist-packages/bench/commands/setup.py”, line 78, in setup_supervisor
if not skip_supervisord and “Permission denied” in get_cmd_output(
File “/usr/local/lib/python3.10/dist-packages/bench/utils/init.py”, line 217, in get_cmd_output
output = subprocess.check_output(
File “/usr/lib/python3.10/subprocess.py”, line 420, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File “/usr/lib/python3.10/subprocess.py”, line 524, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command ‘supervisorctl status’ returned non-zero exit status 1.

Hi

It may help to say the operating environment, version of frappe-bench and if this is an installation that was running well and needed maintenance or if it is new.

What does supervisorctl status return?

supervisorctl status
Traceback (most recent call last):
File “/usr/bin/supervisorctl”, line 33, in
sys.exit(load_entry_point(‘supervisor==4.2.1’, ‘console_scripts’, ‘supervisorctl’)())
File “/usr/lib/python3/dist-packages/supervisor/supervisorctl.py”, line 1406, in main
options.realize(args, doc=doc)
File “/usr/lib/python3/dist-packages/supervisor/options.py”, line 1657, in realize
Options.realize(self, *arg, **kw)
File “/usr/lib/python3/dist-packages/supervisor/options.py”, line 308, in realize
self.process_config()
File “/usr/lib/python3/dist-packages/supervisor/options.py”, line 316, in process_config
self.process_config_file(do_usage)
File “/usr/lib/python3/dist-packages/supervisor/options.py”, line 346, in process_config_file
self.read_config(self.configfile)
File “/usr/lib/python3/dist-packages/supervisor/options.py”, line 1678, in read_config
parser.read_file(fp)
File “/usr/lib/python3.10/configparser.py”, line 719, in read_file
self._read(f, source)
File “/usr/lib/python3.10/configparser.py”, line 1086, in _read
raise MissingSectionHeaderError(fpname, lineno, line)
configparser.MissingSectionHeaderError: File contains no section headers.
file: ‘/etc/supervisor/supervisord.conf’, line: 3
‘chown=ubuntu:ubuntu\n’

A reinstallation of supervisor might help: try sudo apt remove --purge supervisor then sudo apt install supervisor, then bench setup supervisor again. Without knowing if this installation was working well at one time, or if new, and the method of installation, troubleshooting is hit or miss.

1 Like

hi bro thankyou for your support.
I will try these, while initializing new frappe bench
$ sudo supervisorctl restart frappe:
frappe: ERROR (no such group)
frappe: ERROR (no such group)
WARN: restarting supervisor failed. Use bench restart to retry.
I got this warn. Whether your info will help to solve these

Hi @smino
Its working now thank you.

But the login page is not working

Try: bench build

1 Like

I solved it thank you
bench update
bench migrate
bench build
sudo chmod o+x $HOME

I used:

sudo chmod o+x /home/<user>/<bench-dir>
sudo bench setup production <user>
bench restart
1 Like