gunicorn.service: Failed at step CHDIR spawning */fresh_env/bin/gunicorn: No such file or directory

  Kiến thức lập trình

gunicorn.service cannot open WorkingDirectory and the gunicorn executable. I think it's about permissions but I don't know how I can solve it. ** sudo systemctl status gunicorn:`**

 `Apr 12 23:57:08 2818479-qd78506.twc1.net systemd[1]: gunicorn.service: Main process exited, code=exited, status=200/CHDIR`
`Apr 12 23:57:08 2818479-qd78506.twc1.net systemd[1]: gunicorn.service: Failed with result 'exit-code'.`
`Apr 12 23:57:53 2818479-qd78506.twc1.net systemd[78132]: gunicorn.service: Changing to the requested working directory failed: No such file or directory`
`Apr 12 23:57:53 2818479-qd78506.twc1.net systemd[78132]: gunicorn.service: Failed at step CHDIR spawning /var/www/web_app/fresh_env/bin/gunicorn: No such file or dir>`
`Apr 12 23:57:53 2818479-qd78506.twc1.net systemd[1]: Started gunicorn.service.`

**
/etc/systemd/system/gunicorn.service:
**

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

`[Service]`
`User=root`
`WorkingDirectory=/var/www/web_app/webapp  `                                   
`ExecStart=/var/www/web_app/webapp/fresh_env/bin/gunicorn --access-logfile = --workers 5 --bind 

unix:/run/gunicorn.sock webapp.wsgi:application`

`[Install]`
`WantedBy=multi-user.target`

I’ve tried a lot of methods but no one could help me
How to solve it?

New contributor

Иван Ткачёв is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

LEAVE A COMMENT