Reputation: 858
For the last three years below gunicorn configuration worked well:
[program:hys]
command= /usr/local/bin/gunicorn /var/www/h/o/u67098/public_html/project/apps/,/var/www/h/o/u67098/public_html/project/,/var/www/h/o/u67098/public_html/apps/,/var/www/h/o/u67098/public_html/ project.wsgi:application -b=0.0.0.0:8001 --workers=3 --timeout=90 --graceful-timeout=10 --log-level=INFO --log-file /var/www/h/o/u67098/public_html/logs/gun.log
directory = /var/www/h/o/u67098/public_html/project/
user = hys
autostart=true
autorestart=true
stdout_logfile = /var/www/h/o/u67098/public_html/logs/gunicorn_supervisor.log
stderr_logfile= /var/www/h/o/u67098/public_html/logs/gunicorn_err_supervisor.log
redirect_stderr = true ; Save stderr in the same log
environment=LANG=en_US.UTF-8,LC_ALL=en_US.UTF-8
Since NY I am getting this error:
[2020-01-05 10:45:16 +0000] [20624] [INFO] Starting gunicorn 19.7.1
[2020-01-05 10:45:16 +0000] [20624] [INFO] Listening at: http://0.0.0.0:8001 (20624)
[2020-01-05 10:45:16 +0000] [20624] [INFO] Using worker: sync
[2020-01-05 10:45:16 +0000] [20629] [INFO] Booting worker with pid: 20629
[2020-01-05 10:45:16 +0000] [20629] [ERROR] Exception in worker process
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/gunicorn-19.7.1-py2.7.egg/gunicorn/arbiter.py", line 578, in spawn_worker
worker.init_process()
File "/usr/local/lib/python2.7/dist-packages/gunicorn-19.7.1-py2.7.egg/gunicorn/workers/base.py", line 126, in init_process
self.load_wsgi()
File "/usr/local/lib/python2.7/dist-packages/gunicorn-19.7.1-py2.7.egg/gunicorn/workers/base.py", line 135, in load_wsgi
self.wsgi = self.app.wsgi()
File "/usr/local/lib/python2.7/dist-packages/gunicorn-19.7.1-py2.7.egg/gunicorn/app/base.py", line 67, in wsgi
self.callable = self.load()
File "/usr/local/lib/python2.7/dist-packages/gunicorn-19.7.1-py2.7.egg/gunicorn/app/wsgiapp.py", line 65, in load
return self.load_wsgiapp()
File "/usr/local/lib/python2.7/dist-packages/gunicorn-19.7.1-py2.7.egg/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp
return util.import_app(self.app_uri)
File "/usr/local/lib/python2.7/dist-packages/gunicorn-19.7.1-py2.7.egg/gunicorn/util.py", line 352, in import_app
__import__(module)
ImportError: Import by filename is not supported.
The code works, I can start the dev server in Django, no errors. Gunicorn self seems to be working as well, it responds in the command line. I have no other project to test it, but I did reinstall it and the issue persists.
Django 1.11.2 Python 2.7.3 Gunicorn 19.7.1
Any ideas what is wrong here?
Upvotes: 0
Views: 146
Reputation: 32244
Try setting PYTHONPATH
in the environment
setting of your config
environment=LANG=en_US.UTF-8,LC_ALL=en_US.UTF-8,PYTHONPATH=/var/www/h/o/u67098/public_html/project/apps/:/var/www/h/o/u67098/public_html/project/:/var/www/h/o/u67098/public_html/apps/:/var/www/h/o/u67098/public_html/
Upvotes: 1