Error: <class ‘PermissionError’>, [Errno 13] Permission denied: file: /usr/lib/python3/dist-packages/supervisor/xmlrpc.py line: 560

I have followed your steps but I still get the following error.

yarn run v1.22.19
$ node esbuild --production --apps idea_management --run-build-command
clean: postcss.plugin was deprecated. Migration guide:
https://evilmartians.com/chronicles/postcss-8-plugin-migration
File                                                        Size

 DONE  Total Build Time: 367.425ms

clean: postcss.plugin was deprecated. Migration guide:
https://evilmartians.com/chronicles/postcss-8-plugin-migration
clean: postcss.plugin was deprecated. Migration guide:
https://evilmartians.com/chronicles/postcss-8-plugin-migration
clean: postcss.plugin was deprecated. Migration guide:
https://evilmartians.com/chronicles/postcss-8-plugin-migration
 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
Done in 3.81s.
$ supervisorctl restart frappe:
unix:///var/run/supervisor.sock no such file
ERROR: 
Traceback (most recent call last):
  File "/usr/local/bin/bench", line 8, in <module>
    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/make.py", line 181, in new_app
    new_app(app_name, no_git)
  File "/usr/local/lib/python3.10/dist-packages/bench/app.py", line 541, in new_app
    install_app(app, bench_path=bench_path)
  File "/usr/local/lib/python3.10/dist-packages/bench/app.py", line 589, in install_app
    bench.reload()
  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)
  File "/usr/local/lib/python3.10/dist-packages/bench/utils/bench.py", line 304, in restart_supervisor_processes
    bench.run(f"{sudo}supervisorctl restart {group}")
  File "/usr/local/lib/python3.10/dist-packages/bench/bench.py", line 48, in run
    return exec_cmd(cmd, cwd=cwd or self.cwd)
  File "/usr/local/lib/python3.10/dist-packages/bench/utils/__init__.py", line 155, in exec_cmd
    raise CommandFailedError
bench.exceptions.CommandFailedError

Try:

Sudo service supervisor restart

Still didn’t work?
This method worked for me:

Create a group called supervisor, and add user into that group

sudo groupadd supervisor
sudo usermod -a <user> -G supervisor

Now edit supervisor.conf

sudo nano /etc/supervisor/supervisor.conf

and add as follows:

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

then restart supervisord

sudo supervisorctl reload

or

sudo service supervisor restart

8 Likes

This worked for me perfectly, thanks @rbr_elite

Worked for me.

Thankyou

1 Like

Hi. Thanks for helping.

Your solution may make things work but I think it is not security-wise as it gives permissions to any user to read and execute anything inside /home/frappe directory.

Isn’t that what that command does ?

1 Like

should be
supervisord.conf

1 Like

Yes. I forgot to change it. Thanks

works!
After making the permission modifications as indicated,
in my case I wanted to update bank; I did this: restart services with,

sudo service supervisor restart

Before using bench update or bench update --reset again.

I had the same error on my Debian 11 instance. I solved it by removing the supervisor and rebooting the system before the new installation.

Thanks for this… I only added the lines in supervisord.conf though. Doing that and restarting supervisor was sufficient to clear the error

Kind regards,

Yes, that’s what the command does. And it’s not recommended!

Anyways, here is the corresponding bug report for this issue.

Welcome back @scdanieli. I hope the two years gap was filled by good things :sweat_smile:

You’re right, the bug report indicates what really is missing. I already made it work manually by setting the correct chmod and chown values in /etc/supervisor/supervisord.conf as described in this guide for Archlinux.

Hopefully it will get fixed soon.

Hi, I tried these commands:

sudo service supervisor stop
sudo service supervisor start

But am still getting the same error for bench restart

root@vmi934288:/home/calmh/myfrappe# sudo bench restart
$ supervisorctl restart frappe:
unix:///var/run/supervisor.sock no such file
ERROR:
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/local/lib/python3.10/dist-packages/click/core.py”, line 1130, in call
return self.main(*args, **kwargs)
File “/usr/local/lib/python3.10/dist-packages/click/core.py”, line 1055, in main
rv = self.invoke(ctx)
File “/usr/local/lib/python3.10/dist-packages/click/core.py”, line 1657, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/local/lib/python3.10/dist-packages/click/core.py”, line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/usr/local/lib/python3.10/dist-packages/click/core.py”, line 760, 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 315, 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
bench.exceptions.CommandFailedError

This is the correct solution (only the second part, not the chmod -R o+rx)

3 Likes

I have tried adding those lines, even reinstalled still facing same error;

error

Other config file(s) may be corrupted as well. Can you check if have a config file for your bench in /etc/supervisor/conf.d/ and if so, post the content of /etc/supervisor/conf.d/your_bench.conf - So I can compare it to a working one.

This was fixed recently by @gavindsouza

Update bench to latest version.

1 Like