Gunicorn unable to start after server update ( 502 bad gateway )
Hello, I have updated my old Ubuntu server from version 14 to 16.
This also included a Django and Python update.
After restarting the server, I got a 502 error from Nginx, which I have discovered is being caused by Gunicorn not being able to start.
I am able to start gunicorn manually, and the site works perfectly, by doing:
root@server:/home/django/django_project/django_project# gunicorn -b 127.0.0.1:9000 wsgi
wsgi.py is located at /home/django/djangoproject/djangoproject
The problem I am having is that the gunicorn service is not able to start automatically, even if the config (/etc/init/gunicorn.conf) looks correct:
[...] chdir /home/django exec gunicorn \ --name=django_project \ --pythonpath=django_project \ --bind=127.0.0.1:9000 \ --config /etc/gunicorn.d/gunicorn.py \ django_project.wsgi:application
Any ideas of why the service is not starting by itself anymore?
service gunicorn restart
does not work either.
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.×