Question

Socket activation mechanism deploying Django app doesn't work

Posted June 15, 2020 185 views
DjangoDeployment

Hi all,

I’m following this Django, Postgresql, Gunicorn, NGINX toturial to the letter, but when I want to test the socket activation mechanism with curl --unix-socket /run/gunicorn.sock localhost the whole thing just stops with the error below. This is my first time deploying a Django app (even first time deploying anything btw) and I don’t know what to do from here.

Tried adjusting and troubleshooting the gunicorn.service file, but nothing seems to work.

Jun 15 14:48:01 workee-nl systemd[1]: Started gunicorn daemon.
Jun 15 14:48:01 workee-nl gunicorn[26878]: [2020-06-15 14:48:01 +0000] [26878] [INFO] Starting gunicorn 20.0.4
Jun 15 14:48:01 workee-nl gunicorn[26878]: [2020-06-15 14:48:01 +0000] [26878] [INFO] Listening at: unix:/run/gunicorn.sock (26878)
Jun 15 14:48:01 workee-nl gunicorn[26878]: [2020-06-15 14:48:01 +0000] [26878] [INFO] Using worker: sync
Jun 15 14:48:01 workee-nl gunicorn[26878]: [2020-06-15 14:48:01 +0000] [26900] [INFO] Booting worker with pid: 26900
Jun 15 14:48:01 workee-nl gunicorn[26878]: [2020-06-15 14:48:01 +0000] [26900] [ERROR] Exception in worker process
Jun 15 14:48:01 workee-nl gunicorn[26878]: Traceback (most recent call last):
Jun 15 14:48:01 workee-nl gunicorn[26878]:   File "/home/walter/workee/venv/lib/python3.6/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker
Jun 15 14:48:01 workee-nl gunicorn[26878]:     worker.init_process()
Jun 15 14:48:01 workee-nl gunicorn[26878]:   File "/home/walter/workee/venv/lib/python3.6/site-packages/gunicorn/workers/base.py", line 119, in init_process
Jun 15 14:48:01 workee-nl gunicorn[26878]:     self.load_wsgi()
Jun 15 14:48:01 workee-nl gunicorn[26878]:   File "/home/walter/workee/venv/lib/python3.6/site-packages/gunicorn/workers/base.py", line 144, in load_wsgi
Jun 15 14:48:01 workee-nl gunicorn[26878]:     self.wsgi = self.app.wsgi()
Jun 15 14:48:01 workee-nl gunicorn[26878]:   File "/home/walter/workee/venv/lib/python3.6/site-packages/gunicorn/app/base.py", line 67, in wsgi
Jun 15 14:48:01 workee-nl gunicorn[26878]:     self.callable = self.load()
Jun 15 14:48:01 workee-nl gunicorn[26878]:   File "/home/walter/workee/venv/lib/python3.6/site-packages/gunicorn/app/wsgiapp.py", line 49, in load
Jun 15 14:48:01 workee-nl gunicorn[26878]:     return self.load_wsgiapp()
Jun 15 14:48:01 workee-nl gunicorn[26878]:   File "/home/walter/workee/venv/lib/python3.6/site-packages/gunicorn/app/wsgiapp.py", line 39, in load_wsgiapp
Jun 15 14:48:01 workee-nl gunicorn[26878]:     return util.import_app(self.app_uri)
Jun 15 14:48:01 workee-nl gunicorn[26878]:   File "/home/walter/workee/venv/lib/python3.6/site-packages/gunicorn/util.py", line 358, in import_app
Jun 15 14:48:01 workee-nl gunicorn[26878]:     mod = importlib.import_module(module)
Jun 15 14:48:01 workee-nl gunicorn[26878]:   File "/usr/lib/python3.6/importlib/__init__.py", line 126, in import_module
Jun 15 14:48:01 workee-nl gunicorn[26878]:     return _bootstrap._gcd_import(name[level:], package, level)
Jun 15 14:48:01 workee-nl gunicorn[26878]:   File "<frozen importlib._bootstrap>", line 994, in _gcd_import
Jun 15 14:48:01 workee-nl gunicorn[26878]:   File "<frozen importlib._bootstrap>", line 971, in _find_and_load
Jun 15 14:48:01 workee-nl gunicorn[26878]:   File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
Jun 15 14:48:01 workee-nl gunicorn[26878]: ModuleNotFoundError: No module named 'workee.wsgi'
Jun 15 14:48:01 workee-nl gunicorn[26878]: [2020-06-15 14:48:01 +0000] [26900] [INFO] Worker exiting (pid: 26900)
Jun 15 14:48:01 workee-nl gunicorn[26878]: [2020-06-15 14:48:01 +0000] [26903] [INFO] Booting worker with pid: 26903
Jun 15 14:48:01 workee-nl gunicorn[26878]: [2020-06-15 14:48:01 +0000] [26903] [ERROR] Exception in worker process
Jun 15 14:48:01 workee-nl gunicorn[26878]: Traceback (most recent call last):
Jun 15 14:48:01 workee-nl gunicorn[26878]:   File "/home/walter/workee/venv/lib/python3.6/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker
Jun 15 14:48:01 workee-nl gunicorn[26878]:     worker.init_process()
Jun 15 14:48:01 workee-nl gunicorn[26878]:   File "/home/walter/workee/venv/lib/python3.6/site-packages/gunicorn/workers/base.py", line 119, in init_process
Jun 15 14:48:01 workee-nl gunicorn[26878]:     self.load_wsgi()
Jun 15 14:48:01 workee-nl gunicorn[26878]:   File "/home/walter/workee/venv/lib/python3.6/site-packages/gunicorn/workers/base.py", line 144, in load_wsgi
Jun 15 14:48:01 workee-nl gunicorn[26878]:     self.wsgi = self.app.wsgi()
Jun 15 14:48:01 workee-nl gunicorn[26878]:   File "/home/walter/workee/venv/lib/python3.6/site-packages/gunicorn/app/base.py", line 67, in wsgi
Jun 15 14:48:01 workee-nl gunicorn[26878]:     self.callable = self.load()
Jun 15 14:48:01 workee-nl gunicorn[26878]:   File "/home/walter/workee/venv/lib/python3.6/site-packages/gunicorn/app/wsgiapp.py", line 49, in load
Jun 15 14:48:01 workee-nl gunicorn[26878]:     return self.load_wsgiapp()
Jun 15 14:48:01 workee-nl gunicorn[26878]:   File "/home/walter/workee/venv/lib/python3.6/site-packages/gunicorn/app/wsgiapp.py", line 39, in load_wsgiapp
Jun 15 14:48:01 workee-nl gunicorn[26878]:     return util.import_app(self.app_uri)
Jun 15 14:48:01 workee-nl gunicorn[26878]:   File "/home/walter/workee/venv/lib/python3.6/site-packages/gunicorn/util.py", line 358, in import_app
Jun 15 14:48:01 workee-nl gunicorn[26878]:     mod = importlib.import_module(module)
Jun 15 14:48:01 workee-nl gunicorn[26878]:   File "/usr/lib/python3.6/importlib/__init__.py", line 126, in import_module
Jun 15 14:48:01 workee-nl gunicorn[26878]:     return _bootstrap._gcd_import(name[level:], package, level)
Jun 15 14:48:01 workee-nl gunicorn[26878]:   File "<frozen importlib._bootstrap>", line 994, in _gcd_import
Jun 15 14:48:01 workee-nl gunicorn[26878]:   File "<frozen importlib._bootstrap>", line 971, in _find_and_load
Jun 15 14:48:01 workee-nl gunicorn[26878]:   File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
Jun 15 14:48:01 workee-nl gunicorn[26878]: ModuleNotFoundError: No module named 'workee.wsgi'
Jun 15 14:48:01 workee-nl gunicorn[26878]: [2020-06-15 14:48:01 +0000] [26903] [INFO] Worker exiting (pid: 26903)
Jun 15 14:48:02 workee-nl gunicorn[26878]: [2020-06-15 14:48:02 +0000] [26878] [INFO] Shutting down: Master
Jun 15 14:48:02 workee-nl gunicorn[26878]: [2020-06-15 14:48:02 +0000] [26878] [INFO] Reason: Worker failed to boot.
Jun 15 14:48:02 workee-nl systemd[1]: gunicorn.service: Main process exited, code=exited, status=3/NOTIMPLEMENTED
Jun 15 14:48:02 workee-nl systemd[1]: gunicorn.service: Failed with result 'exit-code'.
Jun 15 14:48:02 workee-nl systemd[1]: gunicorn.service: Start request repeated too quickly.
Jun 15 14:48:02 workee-nl systemd[1]: gunicorn.service: Failed with result 'exit-code'.
Jun 15 14:48:02 workee-nl systemd[1]: Failed to start gunicorn daemon.
Submit an answer

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!