Ubuntu – How to fix “chdir(): No such file or directory [uwsgi.c line 1723]” on in wsgi on nginx

djangonginx

I have treeio project in my home directory, now I want to run that treeio in nginx server. Already treeio can independently run on Django comes with the source. I don't want to run that in Django server, but I want to run it on nginx server. I just followed the steps given in this answer of Karthik.

However, while executing or following step 4 from that answer, it throws the following error:

[uWSGI] getting INI configuration from uwsgi.ini
* Starting uWSGI 1.0.3-debian (32bit) on [Thu Jun 27 17:22:01 2013] *
compiled with version: 4.6.3 on 17 July 2012 02:24:04
current working directory: /home/rajesh/treeio
detected binary path: /usr/bin/uwsgi-core
chdir(): No such file or directory [uwsgi.c line 1723]

My uwsgi.ini file contains

[uwsgi] 
# set the http port
http = :8080

# change to django project directory
chdir = /home/treeio/

# add /var/www to the pythonpath, in this way we can use the project.app format
pythonpath = /var/www

# set the project settings name
env = DJANGO_SETTINGS_MODULE=treeio.settings

# load django
module = django.core.handlers.wsgi:WSGIHandler()

Please help me in deploying treeio in nginx server.

Best Answer

The chdir error message indicates that it is trying to get a dir that doesn't exist.

It would appear from your displayed output that, that dir would either be /home/rajesh/treeio or /home/treeio/.

Given that the dir has been configured to act as a relevant django project dir, it would more likely be /home/treeio/; but that configuration may only have been specified in the uwsgi.ini that you have displayed.

Therefore, it is very likely to be in existence, and thus a permission problem, due to the fact that /home/treeio/ does not have to be in existence.

Related Question