Django + gunicorn + virtualenv + Supervisord issue

Solution 1:

I tracked this one down with the help of davisp, a gunicorn developer. Thank you !

It was an environnement issue, caused by an invalid HOME setting in the environnement of the supervisor gunicorn subprocess.

I did not get anything on stderr until I put an "import psycopg2" in my settings.py file, which produced the following message on supervisor's stderr files for gunicorn.

Error: Can't extract file(s) to egg cache

The following error occurred while trying to extract file(s) to the Python egg cache:

  [Errno 13] Permission denied: '/root/.python-eggs'"

I added the following line in my supervisor configuration file for gunicorn, and now Python finds its way to a u+writable egg cache. Everything is OK.

environment=HOME='/home/hc'