Supervisor/Gunicorn/Django: supervisor unable to RUN gunicorn ('fixed' on STARTING)

1.3k Views Asked by At

I try to deploy my Django project using Nginx/Gunicorn and supervisor.

When I run gunicorn directly it works:

(envCov) zebra@zebra:~/intensecov_app/intensecov$ gunicorn coverage.wsgi:application
[2020-05-27 09:41:59 +0000] [45637] [INFO] Starting gunicorn 20.0.4
[2020-05-27 09:41:59 +0000] [45637] [INFO] Listening at: http://127.0.0.1:8000 (45637)
[2020-05-27 09:41:59 +0000] [45637] [INFO] Using worker: sync
[2020-05-27 09:41:59 +0000] [45639] [INFO] Booting worker with pid: 45639

Issue came when I try to used supervisor after config (see below).

I run this 3 command:

(envCov) zebra@zebra:~/intensecov_app/intensecov$ sudo supervisorctl reread
intensecov-gunicorn: available
(envCov) zebra@zebra:~/intensecov_app/intensecov$ sudo supervisorctl update
intensecov-gunicorn: added process group
(envCov) zebra@zebra:~/intensecov_app/intensecov$ sudo supervisorctl status
intensecov-gunicorn              STARTING

As you can see, gunciron programm is STARTING but never RUNNING

I try to 'manually' restart but git an error :

(envCov) zebra@zebra:~/intensecov_app/intensecov$ sudo supervisorctl restart intensecov-gunicorn
intensecov-gunicorn: stopped
intensecov-gunicorn: ERROR (spawn error)

/etc/supervisor/conf.d/intensecov-gunicorn.conf

[program:intensecov-gunicorn]
command = /home/zebra/envs/envCov/bin/gunicorn coverage.wsgi:application
user = zebra
directory = /home/zebra/intensecov_app
autostart = true
autorestart = true

1

There are 1 best solutions below

0
On

I fix my issue by changing directory path

[program:intensecov-gunicorn]
command = /home/zebra/envs/envCov/bin/gunicorn coverage.wsgi:application
user = zebra
directory = /home/zebra/intensecov_app/intensecov ***path modifyed***
autostart = true
autorestart = true