[Fixed]-Gunicorn.socket: Failed with result 'service-start-limit-hit'

22👍

I don’t know django, but I am going to assume that this issue is similar to an issue I saw trying to get the MySQL service to start on one of my servers today (see here: https://stackoverflow.com/a/55141733/708323)

Basically, the “start-limit-hit” message is a red herring – service start tries to start which ever service name you provide multiple times, and if after the fifth failed attempt (for me, at least) it crashes out on the sixth attempt with “start-limit-hit”. You’ll need to investigate the actual syslog (possibly /var/log/syslog) to see what the real errors are that are preventing the service from starting on attempts 1-5.

1👍

Check whether you have proper permissions for the user/group mentioned inside the gunicorn.service file.

I had the same issue, my gunicorn file had:

[Service]
User= www-data 
Group= www-data

I changed the permission of gunicorn service file, socket file and django directory and it worked fine.

chown www-data:www-data /etc/systemd/system/gunicorn.service
chown www-data:www-data /etc/systemd/system/gunicorn.socket
chown www-data:www-data -R myproject/

Hope, it helps.

0👍

My issue was related to Django settings

Django used sqlite3 instead of pgsql because of wrong environment variables values

So my suggestion is to start from /var/log/syslog and try to start gunicorn without nginx

Something like gunicorn --workers=2 'zt.wsgi' -b 0.0.0.0:8000 and then check your website url on 8000 port

Leave a comment