Creating new app and bench restart

I have this error how to solve
ERROR: Command ‘sudo supervisorctl status’ returned non-zero exit status 1.

I opened etc/supervisor/supervisord.conf

It has
chmod=0760
chown=frappe:frappe

.MissingSectionHeaderError: File contains no section headers.
file: ‘/etc/supervisor/supervisord.conf’, line: 1
‘chmod=0760\n’

hello, you dont need supervisor if you work in develop mode (without nginx & supervisor)
if not please show your whole “supervisord.conf” file content

There should be headers within the file

[unix_http_server]
file=/var/run/supervisor.sock   ; (the path to the socket file)
;chmod=0700                       ; sockef file mode (default 0700)
chmod=0760
chown=**erpnextuser**:supervisor

[unix_http_server]
file=/var/run/supervisor.sock ; (the path to the socket file)
;chmod=0700 ; sockef file mode (default 0700)
chmod=0760
chown=frappe:frappe
~

bench new-app lbs
App Title [Lbs]:
App Description: l
App Publisher: l
App Email: l@gmail.com
App License [MIT]:
Create GitHub Workflow action for unittests [y/N]: y
‘lbs’ created at /Users/ramki/frappe-bench/apps/lbs
Installing lbs
$ /Users/ramki/frappe-bench/env/bin/python -m pip install --quiet --upgrade -e /Users/ramki/frappe-bench/apps/lbs
$ bench build --app lbs
Linking /Users/ramki/frappe-bench/apps/frappe/node_modules to ./assets/frappe/node_modules Linking /Users/ramki/frappe-bench/apps/hackathonchennai2023/hackathonchennai2023/public to ./assets/hackathonchennai2023 Linking /Users/ramki/frappe-bench/apps/meeting/meeting/public to ./assets/meeting Linking /Users/ramki/frappe-bench/apps/demo_app/demo_app/public to ./assets/demo_app :heavy_check_mark: Application Assets Linked

yarn run v1.22.18
$ node esbuild --apps lbs --run-build-command
File Size

DONE Total Build Time: 294.101ms

WARN Cannot connect to redis_cache to update assets_json
WARN Cannot connect to redis_cache to update assets_json
WARN Cannot connect to redis_cache to update assets_json
:sparkles: Done in 4.14s.
Password:
ERROR: Command ‘sudo supervisorctl status’ returned non-zero exit status 2.
Traceback (most recent call last):
File “/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/bench/utils/bench.py”, line 287, in restart_supervisor_processes
supervisor_status = get_cmd_output(“supervisorctl status”, cwd=bench_path)
File “/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/bench/utils/init.py”, line 212, in get_cmd_output
output = subprocess.check_output(cmd, cwd=cwd, shell=True, stderr=subprocess.PIPE, encoding=“utf-8”).strip()
File “/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/subprocess.py”, line 420, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File “/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/subprocess.py”, line 524, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command ‘supervisorctl status’ returned non-zero exit status 2.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/Library/Frameworks/Python.framework/Versions/3.10/bin/bench”, line 8, in
sys.exit(cli())
File “/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/bench/cli.py”, line 121, in cli
raise e
File “/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/bench/cli.py”, line 111, in cli
bench_command()
File “/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/click/core.py”, line 1130, in call
return self.main(*args, **kwargs)
File “/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/click/core.py”, line 1055, in main
rv = self.invoke(ctx)
File “/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/click/core.py”, line 1657, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/click/core.py”, line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/click/core.py”, line 760, in invoke
return __callback(*args, **kwargs)
File “/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/bench/commands/make.py”, line 177, in new_app
new_app(app_name, no_git)
File “/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/bench/app.py”, line 524, in new_app
install_app(app, bench_path=bench_path)
File “/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/bench/app.py”, line 567, in install_app
bench.reload()
File “/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/bench/utils/render.py”, line 110, in wrapper_fn
return fn(*args, **kwargs)
File “/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/bench/bench.py”, line 151, in reload
restart_supervisor_processes(bench_path=self.name, web_workers=web)
File “/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/bench/utils/bench.py”, line 293, in restart_supervisor_processes
supervisor_status = get_cmd_output(“sudo supervisorctl status”, cwd=bench_path)
File “/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/bench/utils/init.py”, line 212, in get_cmd_output
output = subprocess.check_output(cmd, cwd=cwd, shell=True, stderr=subprocess.PIPE, encoding=“utf-8”).strip()
File “/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/subprocess.py”, line 420, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File “/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/subprocess.py”, line 524, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command ‘sudo supervisorctl status’ returned non-zero exit status 2.

is that the whole file content ? also try running this command
sudo supervisorctl status

sudo supervisorctl status
Error: .ini file does not include supervisorctl section
For help, use /Library/Frameworks/Python.framework/Versions/3.10/bin/supervisorctl -h

you dont have [supervisorctl] in your config file, maybe you deleted that line or commented it with “;” by mistake you can check. this is how my config file look

; supervisor config file

[unix_http_server]
file=/var/run/supervisor.sock   ; (the path to the socket file)
chmod=0700                       ; sockef file mode (default 0700)
chown=rust:rust

[supervisord]
logfile=/var/log/supervisor/supervisord.log ; (main log file;default $CWD/supervisord.log)
pidfile=/var/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
childlogdir=/var/log/supervisor            ; ('AUTO' child log dir, default $TEMP)

; the below section must remain in the config file for RPC
; (supervisorctl/web interface) to work, additional interfaces may be
; added by defining them in separate rpcinterface: sections
[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface

[supervisorctl]
serverurl=unix:///var/run/supervisor.sock ; use a unix:// URL  for a unix socket

; The [include] section can just contain the "files" setting.  This
; setting can list multiple files (separated by whitespace or
; newlines).  It can also contain wildcards.  The filenames are
; interpreted as relative to this file.  Included files *cannot*
; include files themselves.

[include]
files = /etc/supervisor/conf.d/*.conf

Hi bro thanks for the update, I solve that error now i got

http://localhost:9001 refused connection
ERROR:
Traceback (most recent call last):
File “/Library/Frameworks/Python.framework/Versions/3.10/bin/bench”, line 8, in
sys.exit(cli())
File “/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/bench/cli.py”, line 121, in cli
raise e
File “/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/bench/cli.py”, line 111, in cli
bench_command()
File “/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/click/core.py”, line 1130, in call
return self.main(*args, **kwargs)
File “/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/click/core.py”, line 1055, in main
rv = self.invoke(ctx)
File “/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/click/core.py”, line 1657, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/click/core.py”, line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/click/core.py”, line 760, in invoke
return __callback(*args, **kwargs)
File “/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/bench/commands/make.py”, line 177, in new_app
new_app(app_name, no_git)
File “/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/bench/app.py”, line 524, in new_app
install_app(app, bench_path=bench_path)
File “/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/bench/app.py”, line 567, in install_app
bench.reload()
File “/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/bench/utils/render.py”, line 110, in wrapper_fn
return fn(*args, **kwargs)
File “/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/bench/bench.py”, line 151, in reload
restart_supervisor_processes(bench_path=self.name, web_workers=web)
File “/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/bench/utils/bench.py”, line 309, in restart_supervisor_processes
bench.run(f"{sudo}supervisorctl restart {group}")
File “/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/bench/bench.py”, line 47, in run
return exec_cmd(cmd, cwd=cwd or self.cwd)
File “/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/bench/utils/init.py”, line 153, in exec_cmd
raise CommandFailedError
bench.exceptions.CommandFailedError

supervisorctl
http://localhost:9001 refused connection
supervisor>

not sure how you did install your frappe server but maybe its better to create new fresh server anyway try this command it may help “sudo bench setup production $USER”

Thanks for your time.
I started again with bench init frappe
Its worked for me. Thankyou bro

1 Like