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

ERPNext 12 Installation Guide

ERPNext 13 Installation Guide

ERPNext 14DEV Installation Guide

.

.After productions is up. if you want to add any other app. just go through with below setup to avoid
error: <class ‘PermissionError’>, [Errno 13] Permission denied: file: /usr/lib/python3/dist-packages/supervisor/xmlrpc.py line: 560

===========================================

go to bench folder

sudo service supervisor stop
sudo service nginx stop
bench start

OPEN NEW SESSION

go to bench folder

bench get-app chat
make sure bench is runing in other terminal

bench get-app https://github.com/libracore/woocommerceconnector.git
make sure bench is runing in other terminal

bench get-app healthcare
make sure bench is runing in other terminal

bench get-app hospitality
make sure bench is runing in other terminal

bench --site site1.local install-app chat
make sure bench is runing in other terminal

bench --site site1.local install-app woocommerceconnector
make sure bench is runing in other terminal

bench --site site1.local install-app healthcare
make sure bench is runing in other terminal

bench --site site1.local install-app hospitality
make sure bench is runing in other terminal

bench use site1.local
bench migrate
sudo service supervisor start
sudo service nginx start
bench --site site1.local clear-website-cache


.
.

2 Likes

Dear @Usman_Ali
I have the same error after production setup as you pointed out when I use “bench restart”
error: <class ‘PermissionError’>, [Errno 13] Permission denied: file: /usr/lib/python3/dist-packages/supervisor/xmlrpc.py line: 560

How can I fix this problem? Thanks a lot

@minhtran @Usman_Ali
I have same error, have you fix it?

2 Likes

@Ala_Alsalam, @minhtran

Try this, it works with me.

chmod -R o+rx /home/frappe (Caution, unsafe!)

and

sudo nano /etc/supervisor/supervisord.conf

(Add these lines under [unix_http_server])

chmod=0760
chown=frappe:frappe
19 Likes

you might also need to restart supervisor

sudo -A systemctl restart supervisor

7 Likes

Thanks, its helpful.

1 Like

It’s Helped me. Thank you.

1 Like

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.