0

I can't figure out what's wrong. Spend almost 2 days on this error and I am not able to find if it is a typo or concept mistake. I want to mention that the app started perfectly using `python3 manage.py runserver 0.0.0.0:8080.

My environment is on this path: home/paul/env My project directory is on this path: home/paul/project wsgi file is on this path: home/paul/project/application

gunicorn.socket

[Unit]
Description=gunicorn socket

[Socket]
ListenStream=/run/gunicorn.sock

[Install]
WantedBy=sockets.target

gunicorn.service

[Unit]
Description=gunicorn daemon
Requires=gunicorn.socket
After=network.target

[Service]
User=paul
Group=paul # i also used www-data
WorkingDirectory=/home/paul/project
ExecStart=/home/paul/env/bin/gunicorn \
          --access-logfile - \
          --workers 3 \
          --bind unix:/run/gunicorn.sock \
          application.wsgi:application

[Install]
WantedBy=multi-user.target                        

When I run sudo systemctl status gunicorn.socket, as you can see below everything looks fine, enabled, active.

● gunicorn.socket - gunicorn socket
     Loaded: loaded (/etc/systemd/system/gunicorn.socket; enabled; preset: enabled)
     Active: active (listening) since Tue 2023-04-11 12:31:59 UTC; 32min ago
      Until: Tue 2023-04-11 12:31:59 UTC; 32min ago
   Triggers: ● gunicorn.service
     Listen: /run/gunicorn.sock (Stream)
     CGroup: /system.slice/gunicorn.socket

But when I run sudo systemctl status gunicorn it fails.

× gunicorn.service - gunicorn daemon
     Loaded: loaded (/etc/systemd/system/gunicorn.service; enabled; preset: enabled)
     Active: failed (Result: resources)
TriggeredBy: ● gunicorn.socket
        CPU: 0

The error make you think about the resources, but I checked and there are enough resources.

Paul Viorel
  • 234
  • 1
  • 11

0 Answers0