Переход с SQLite на Mysql в производстве вызывает ошибку

Я использую сервер Digital Ocean. После перехода на базу данных mysql с sqlite, я получил 502 Bad Gateway nginx/1.18.0 (Ubuntu)

Когда я запускаю проект из терминала с помощью python manage.py runserver ip:8000 , он работает нормально. Я думаю, что есть ошибки в gunicorn .

Как решить эту проблему, есть идеи?

После проверки журналов,

sudo tail -F /var/log/nginx/error.log


2021/12/06 10:32:06 [error] 230230#230230: *15355 connect() to unix:/run/gunicorn.sock failed (111: Connection refused) while connecting to upstream, client: 113.199.220.31, server: develop-330.gsa-cs.com, request: "GET / HTTP/1.1", upstream: "http://unix:/run/gunicorn.sock:/", host: "develop-330.gsa-cs.com"
2021/12/06 10:37:21 [error] 230230#230230: *15358 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 113.199.220.31, server: develop-330.gsa-cs.com, request: "GET / HTTP/1.1", upstream: "http://unix:/run/gunicorn.sock:/", host: "develop-330.gsa-cs.com"
2021/12/06 10:37:24 [error] 230230#230230: *15358 connect() to unix:/run/gunicorn.sock failed (111: Connection refused) while connecting to upstream, client: 113.199.220.31, server: develop-330.gsa-cs.com, request: "GET / HTTP/1.1", upstream: "http://unix:/run/gunicorn.sock:/", host: "develop-330.gsa-cs.com"
2021/12/06 10:44:06 [error] 230230#230230: *15365 connect() to unix:/run/gunicorn.sock failed (111: Connection refused) while connecting to upstream, client: 113.199.220.31, server: develop-330.gsa-cs.com, request: "GET / HTTP/1.1", upstream: "http://unix:/run/gunicorn.sock:/", host: "develop-330.gsa-cs.com"
2021/12/06 10:48:35 [error] 230230#230230: *15368 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 113.199.220.31, server: develop-330.gsa-cs.com, request: "GET / HTTP/1.1", upstream: "http://unix:/run/gunicorn.sock:/", host: "develop-330.gsa-cs.com"
2021/12/06 10:49:10 [notice] 1347821#1347821: signal process started
2021/12/06 10:49:15 [error] 1347822#1347822: *15371 connect() to unix:/run/gunicorn.sock failed (111: Connection refused) while connecting to upstream, client: 113.199.220.31, server: develop-330.gsa-cs.com, request: "GET / HTTP/1.1", upstream: "http://unix:/run/gunicorn.sock:/", host: "develop-330.gsa-cs.com"
2021/12/06 10:51:10 [error] 1347822#1347822: *15374 connect() to unix:/run/gunicorn.sock failed (111: Connection refused) while connecting to upstream, client: 113.199.220.31, server: develop-330.gsa-cs.com, request: "GET / HTTP/1.1", upstream: "http://unix:/run/gunicorn.sock:/", host: "develop-330.gsa-cs.com"
2021/12/06 10:56:54 [error] 1347822#1347822: *15377 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 113.199.220.31, server: develop-330.gsa-cs.com, request: "GET / HTTP/1.1", upstream: "http://unix:/run/gunicorn.sock:/", host: "develop-330.gsa-cs.com"
2021/12/06 11:00:09 [error] 1347822#1347822: *15381 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 113.199.220.31, server: develop-330.gsa-cs.com, request: "GET / HTTP/1.1", upstream: "http://unix:/run/gunicorn.sock:/", host: "develop-330.gsa-cs.com"
Вернуться на верх