3π
I just had the very same error message thrown at me (were you also following a Digital Ocean tutorial?) and spent quite a few hours trying to figure it out. I donβt know if you still need it, but perhaps I can spare someone else from wasting as much time as I did.
I managed to fix it (after several different attempts) by:
-
Stopping gunicorn:
sudo systemctl stop gunicorn
-
Changing writing permissions in both directories containing
gunicorn.service
:sudo chmod u+x /etc/systemd/system/multi-user.target.wants/gunicorn-project.service
sudo chmod u+x /etc/systemd/system/gunicorn-project.service
-
Manually deleting and rebuilding the
gunicorn-project.service
symlink:unlink /etc/systemd/system/multi-user.target.wants/gunicorn-project.service
rm /etc/systemd/system/multi-user.target.wants/gunicorn-project.service
ln -s /etc/systemd/system/gunicorn-project.service /etc/systemd/system/multi-user.target.wants/gunicorn-project.service
-
Reloading gunicorn daemon:
sudo systemctl daemon-reload
-
Restarting gunicorn:
sudo systemctl start gunicorn
sudo systemctl enable gunicorn
And the status changed to active (running)
. Basically, at some point, I installed gunicorn without setting proper permissions. Once I redid those steps with the right permissions, gunicorn was able to execute as intended.
OBS: my file was named gunicorn.service
, which I believe is the default. I changed to gunicorn-project.service
to match OPβs terminology.