[mod_python] mod_wsgi (pid=88536): Unable to change working directory

mog lists at elasticmind.net
Tue Jan 12 17:44:18 EST 2010


On 12/01/2010 21:24, mog wrote:
> Hi,
>
> I'm seeing this error in my main Apache log when I switched to using 
> daemon mode:
>
> [Tue Jan 12 21:13:47 2010] [alert] (2)No such file or directory: 
> mod_wsgi (pid=88536): Unable to change working directory to 
> '/nonexistent'.
>
> Not sure why it would be happening though, why mod_wsgi would need to 
> change directories, or what the "correct" solution is? If someone 
> could please point me in the right direction, it would be greatly 
> appreciated.
>
> Thanks,
> mog
>

I read that mod_wsgi's daemon mode is the way forward, so let's "make it 
so". It doesn't seem to want to play nicely though.

The 'unable to change working directory' problems sort of go away if I 
specify 'WSGIDaemonProcess home=/root', but that just doesn't feel right 
to me. Is there something more appropriate I should be using for that?

My Apache vhost config is pretty normal with these WSGI specifics in:

     WSGIDaemonProcess meow.elasticmind.net processes=1 threads=5 
home=/root display-name=%{GROUP}
     WSGIProcessGroup meow.elasticmind.net
     WSGIApplicationGroup %{GLOBAL}
     WSGIScriptAlias / /home/test/trunk/test/test.wsgi

These are all present inside the VirtualHost directive but not contained 
within any Directory directives etc.

Unfortunately though, it doesn't seem happy with these things. The only 
error messages I'm seeing are these:

     [error] Script timed out before returning headers: test.wsgi

The content of test.wsgi is:

def application(environ, start_response):
     status = '200 OK'
     output = 'Hello World!'
     response_headers = [('Content-type', 'text/plain'),
                         ('Content-Length', str(len(output)))]
     start_response(status, response_headers)
     return [output]

So without the DaemonProcess process stuff, this works absolutely fine. 
With the daemon mode process stuff, it breaks :(

Thanks in advanced,
mog


More information about the Mod_python mailing list