502 bad gateway errors and no output from supervisorctl tail frappe:frappe-web


Recently we have been encountering large amount of 502 errors from the website.

It looks like socket errors on gunicorn. Also when I was looking in to this and read some of forum posts here regarding 502 issues I found out that there seems to be a problem with the supervisor setup somehow, even though it has been set up with sudo bench setup production frappe

Output of sudo supervisorctl status:

erpnext-bench-redis:erpnext-bench-redis-cache                 RUNNING   pid 808, uptime 0:33:57
erpnext-bench-redis:erpnext-bench-redis-queue                 RUNNING   pid 809, uptime 0:33:57
erpnext-bench-redis:erpnext-bench-redis-socketio              RUNNING   pid 810, uptime 0:33:57
erpnext-bench-web:erpnext-bench-frappe-web                    RUNNING   pid 811, uptime 0:33:57
erpnext-bench-web:erpnext-bench-node-socketio                 RUNNING   pid 812, uptime 0:33:57
erpnext-bench-workers:erpnext-bench-frappe-default-worker-0   RUNNING   pid 814, uptime 0:33:57
erpnext-bench-workers:erpnext-bench-frappe-long-worker-0      RUNNING   pid 824, uptime 0:33:57
erpnext-bench-workers:erpnext-bench-frappe-schedule           RUNNING   pid 813, uptime 0:33:57
erpnext-bench-workers:erpnext-bench-frappe-short-worker-0     RUNNING   pid 815, uptime 0:33:57

As discussed here: 502 bad gateway nginx 1.2.1 it seems like supervisor configuration is not set properly as sudo supervisorctl tail frappe:frappe-web returns frappe:frappe-web: ERROR (no such process name).

I have setup the environment with bench setup production and as such the supervisor config should be properly set but seems like it doesn’t work properly. After redoing the the sudo bench setup production frappe I now get:

ubuntu@ip-172-31-43-14:~$ sudo supervisorctl status
http://localhost:9001 refused connection

Any ideas how to fix this?

Does anyone have any clue how to start fixing this issue?

same error also :face_exhaling:

Hi! Have you been able to resolve this? I cannot get this to work. Any help on troubleshooting would be highly appreciated.

As a clarification the same site works properly when running with bench start.

Hi! Have you been able to solve this? At the moment we cannot run this site in any other mode than with the bench start command that starts everything properly…

yes i fixed it , i will explain it in details , but for now there were 2 major things must be run or rerun it

nginx , supervisor

the error becuase the Supervisor is not installed correctly ,

also the if you don’t want bench start everytime you restart the system

you need to turn off developermode by make it = 0 .


Thanks for the reply. I already have developer mode disabled, as the bench was initialized in production mode.

Could you explain in more detail how you fixed those nginx and supervisor? Did you just use
bench setup supervisor and bench setup nginx