Non-Writable Python Egg Cache Directory causes mod_fastcgi to send an error 500 with Apache 2
|Reported by:||Owned by:|
First my config:
$ uname -a Darwin bioweb.umtri.umich.edu 9.6.0 Darwin Kernel Version 9.6.0: Mon Nov 24 17:37:00 PST 2008; root:xnu-1228.9.59~1/RELEASE_I386 i386 $ httpd -v Server version: Apache/2.2.9 (Unix) Server built: Sep 19 2008 10:58:54 $ python -V Python 2.5.1 $ trac-admin -v trac-admin 0.11.2.1
This was an upgrade, from a trac 0.11 beta. this error drove me nuts because
tracd worked properly as did
after the upgrade all I was able to get via my server was an error 500 (internal server error), no *useful* debugging information was available anywhere.
After futzing with anything/everything I could think of for over an hour, I finally decided to try trac.cgi instead of trac.fcgi. trac.cgi gave me an error that stated
The Python egg cache directory is currently set to: /Library/WebServer/.python-eggs Perhaps your account does not have write access to this directory? You can change the cache directory by setting the PYTHON_EGG_CACHE environment variable to point to an accessible directory.
To fix this problem I added
os.environ['PYTHON_EGG_CACHE'] = "/some/writable/path/to/.python-eggs" to my trac.cgi file, and all of a sudden trac started working. I then added that line to my trac.fcgi file and then fcgi started working again.
So there is potentially three bugs…
- Maybe most importantly, if the PYTHON_EGG_CACHE location isn't writable fcgi does not display an error message with any relevant information
- the default PYTHON_EGG_CACHE is not being set properly on OS X 10.5.6
- the documentation of
wiki/TracFastCgiis missing critical information
This problem is "slightly" documented at http://trac.edgewall.org/wiki/TracOnLeopardServer