I have been trying to deploy django application inside digital ocean ubunut vps for 12 hours. But can't solve this issue. Everything running just fine gunicorn, nginx eveyrhting looks good but still getting this error. Even tried to run it using my ip address:8000 and it ran well also.
Here is the status of gunicorn:
● gunicorn.service - gunicorn daemon
Loaded: loaded (/etc/systemd/system/gunicorn.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2023-07-05 14:28:46 UTC; 1h 0min ago
TriggeredBy: ● gunicorn.socket
Main PID: 159720 (gunicorn)
Tasks: 4 (limit: 1116)
Memory: 258.2M
CPU: 45.358s
CGroup: /system.slice/gunicorn.service
├─159720 /root/venv/bin/python3 /root/venv/bin/gunicorn --access-logfile - --workers 3 --bind unix:/run/gunicorn.sock LeadScrapper.wsgi:application
├─159721 /root/venv/bin/python3 /root/venv/bin/gunicorn --access-logfile - --workers 3 --bind unix:/run/gunicorn.sock LeadScrapper.wsgi:application
├─159722 /root/venv/bin/python3 /root/venv/bin/gunicorn --access-logfile - --workers 3 --bind unix:/run/gunicorn.sock LeadScrapper.wsgi:application
└─159723 /root/venv/bin/python3 /root/venv/bin/gunicorn --access-logfile - --workers 3 --bind unix:/run/gunicorn.sock LeadScrapper.wsgi:application
Jul 05 15:16:59 scrapper gunicorn[159722]: File "/root/venv/lib/python3.10/site-packages/selenium/webdriver/chrome/webdriver.py", line 49, in __init__
Jul 05 15:16:59 scrapper gunicorn[159722]: super().__init__(
Jul 05 15:16:59 scrapper gunicorn[159722]: File "/root/venv/lib/python3.10/site-packages/selenium/webdriver/chromium/webdriver.py", line 51, in __init__
Jul 05 15:16:59 scrapper gunicorn[159722]: self.service.start()
Jul 05 15:16:59 scrapper gunicorn[159722]: File "/root/venv/lib/python3.10/site-packages/selenium/webdriver/common/service.py", line 97, in start
Jul 05 15:16:59 scrapper gunicorn[159722]: self.assert_process_still_running()
Jul 05 15:16:59 scrapper gunicorn[159722]: File "/root/venv/lib/python3.10/site-packages/selenium/webdriver/common/service.py", line 110, in assert_process_still_running
Jul 05 15:16:59 scrapper gunicorn[159722]: raise WebDriverException(f"Service {self._path} unexpectedly exited. Status code was: {return_code}")
Jul 05 15:16:59 scrapper gunicorn[159722]: selenium.common.exceptions.WebDriverException: Message: Service /usr/bin/chromedriver unexpectedly exited. Status code was: 1
Jul 05 15:16:59 scrapper gunicorn[159722]: - - [05/Jul/2023:15:16:59 +0000] "GET /cdn-cgi/trace HTTP/1.0" 500 0 "-" "-"
This is the status for gunicorn.socket:
gunicorn.socket - gunicorn socket
Loaded: loaded (/etc/systemd/system/gunicorn.socket; enabled; vendor preset: enabled)
Active: active (running) since Wed 2023-07-05 14:28:46 UTC; 1h 0min ago
Triggers: ● gunicorn.service
Listen: /run/gunicorn.sock (Stream)
CGroup: /system.slice/gunicorn.socket
Jul 05 14:28:46 scrapper systemd[1]: gunicorn.socket: Deactivated successfully.
Jul 05 14:28:46 scrapper systemd[1]: Closed gunicorn socket.
Jul 05 14:28:46 scrapper systemd[1]: Stopping gunicorn socket...
Jul 05 14:28:46 scrapper systemd[1]: Listening on gunicorn socket.
Here is the nginx -t:
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
here is my gunicorn service:
[Unit]
Description=gunicorn daemon
Requires=gunicorn.socket
After=network.target
[Service]
User=root
Group=www-data
WorkingDirectory=/root/leadscrapper.nl
ExecStart=/root/venv/bin/gunicorn \
--access-logfile - \
--workers 3 \
--bind unix:/run/gunicorn.sock \
LeadScrapper.wsgi:application
[Install]
WantedBy=multi-user.target
Here is my nginx:
server{
listen 80;
server_name 134.209.71.166;
location = /favicon.ico { access_log off; log_not_found off; }
error_log /root/logs/nginx_error.log;
location /static/ {
root /leadscrapper.nl;
}
location / {
include proxy_params;
proxy_pass http://unix:/run/gunicorn.sock;
}
}
I have no idea why I am getting this error!! Can someone come forward to help me solve this issue?