I was trying to deploy a Django app on aws using postgres, gunicorn and nginx
After the initial setup, I added the Django app from a git repository after that I am getting a 502 Bad Gateway
Here is the gunicorn status
ubuntu@ip-172-31-4-106:~/myproject$ sudo systemctl status gunicorn
● gunicorn.service - gunicorn daemon
Loaded: loaded (/etc/systemd/system/gunicorn.service; disabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Thu 2021-01-07 01:08:56 UTC; 2h 25min ago
TriggeredBy: ● gunicorn.socket
Process: 54260 ExecStart=/home/ubuntu/myproject/myprojectenv/bin/gunicorn --access-logfile - --workers 3 --bind uni> Main PID: 54260 (code=exited, status=1/FAILURE)
Here is the nginx error log:
Jan 07 01:08:56 ip-172-31-4-106 gunicorn[54260]: File "/home/ubuntu/myproject/myprojectenv/lib/python3.8/site-package>Jan 07 01:08:56 ip-172-31-4-106 gunicorn[54260]: self.reap_workers()
Jan 07 01:08:56 ip-172-31-4-106 gunicorn[54260]: File "/home/ubuntu/myproject/myprojectenv/lib/python3.8/site-package>Jan 07 01:08:56 ip-172-31-4-106 gunicorn[54260]: raise HaltServer(reason, self.WORKER_BOOT_ERROR)
Jan 07 01:08:56 ip-172-31-4-106 gunicorn[54260]: gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3>
Jan 07 01:08:56 ip-172-31-4-106 systemd[1]: gunicorn.service: Main process exited, code=exited, status=1/FAILURE
Jan 07 01:08:56 ip-172-31-4-106 systemd[1]: gunicorn.service: Failed with result 'exit-code'.
Jan 07 01:08:56 ip-172-31-4-106 systemd[1]: gunicorn.service: Start request repeated too quickly.
Jan 07 01:08:56 ip-172-31-4-106 systemd[1]: gunicorn.service: Failed with result 'exit-code'.
Jan 07 01:08:56 ip-172-31-4-106 systemd[1]: Failed to start gunicorn daemon.
Couldn't find any solution for this problem please help
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…