bench icon indicating copy to clipboard operation
bench copied to clipboard

bench restart error: <class 'socket.error'>, [Errno 13] Permission denied

Open nameduser0 opened this issue 3 years ago • 6 comments

  • [x] Can you replicate the issue on the supported bench versions?

Description :chart_with_downwards_trend: bench restart gives an error

To Reproduce :page_with_curl: Steps to reproduce the behavior:

  1. Checkout latest develop bench in production mode
  2. Run bench restart

Expected behavior :chart_with_upwards_trend: No error

OS (please complete the following information): :cyclone:

  • [x] Linux: Ubuntu:18.04

Version Information

  • Bench Branch: develop
  • Frappe Version: 13.0.0-dev

Error :page_facing_up:

$ bench restart
$ supervisorctl restart frappe:
error: <class 'socket.error'>, [Errno 13] Permission denied: file: /usr/lib/python2.7/socket.py line: 228
INFO: A newer version of bench is available: 5.2.1 → 5.3.0

nameduser0 avatar Mar 11 '21 00:03 nameduser0

Seems like the supervisor processes may be running as the root process. Restarting supervisor should take care of this since the supervisord config was changed in v5.1.

gavindsouza avatar Apr 26 '21 07:04 gavindsouza

How can we solve this? The bug breaks the update process and we're having to run bench with sudo.

toofun666 avatar Jun 25 '21 05:06 toofun666

I could solve this issue by adapting following instructions: https://coffeeonthekeyboard.com/using-supervisorctl-with-linux-permissions-but-without-root-or-sudo-977/

; 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=frappe:frappe

jHetzer avatar Feb 10 '22 08:02 jHetzer

Let me try. Thank you.

Regards,

Tufan Kaynak

Framras Tibbi Cihazlar Bilisim Sanayi ve Ticaret Anonim Sirketi

Mobile: +90 532 551 7043

Headquarters: Meric Mh. 5747/10 Sk. No.20/11 35090 Bornova IZMIR-TURKEY

Tel. : +90 232 241 1417

WeChat: wxid_gkqj95ulxj7f22

Skype: @.***

From: jHetzer @.*** Sent: Thursday, February 10, 2022 11:06 AM To: frappe/bench @.> Cc: Tufan Kaynak @.>; Comment < @.***> Subject: Re: [frappe/bench] bench restart error: <class 'socket.error'>, [Errno 13] Permission denied (#1136)

I could solve this issue by adapting following instructions: https://coffeeonthekeyboard.com/using-supervisorctl-with-linux-permissions-but-without-root-or-sudo-977/

; 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=frappe:frappe

— Reply to this email directly, view it on GitHub https://github.com/frappe/bench/issues/1136#issuecomment-1034606471, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHNTFTZT52HO6KRC2NMSBT3U2NWXFANCNFSM4Y7G37JQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you commented.Message ID: < @.***>

toofun666 avatar Feb 10 '22 12:02 toofun666

Seems like the supervisor processes may be running as the root process. Restarting supervisor should take care of this since the supervisord config was changed in v5.1.

Didn't Gavin already solve this above?

nameduser0 avatar Feb 10 '22 12:02 nameduser0