I upgraded trac on a qa-site the other day, but then found I was getting “500 internal server error” about every other post.
Investigating revealed a log barf disguised as a stack trace, the final line of which was:
[Thu Mar 12 14:47:23 2009] [error] [client 24.16.139.248] PythonHandler trac.web.modpython_frontend: ExtractionError: Can’t extract file(s) to egg cache\n\nThe following error occurred while trying to extract file(s) to the Python egg\ncache:\n\n [Errno 13] Permission denied: ‘/www/sites/fluffy/trac/.egg-cache’\n\nThe Python egg cache directory is currently set to:\n\n /www/sites/fluffy/trac/.egg-cache\n\nPerhaps your account does not have write access to this directory? You can\nchange the cache directory by setting the PYTHON_EGG_CACHE environment\nvariable to point to an accessible directory.\n, referer: http://fluffy.qa-site.com/trac/wiki/BuildFlexSdk?action=edit
I tried a simple solution, by creating the directory .egg-cache and giving apache write access. But that’s no good.
Alternately, you could change the location of the environment variable PYTHON_EGG_CACHE.
You can do this with CGI, A bit better of a fix is to add the following line to your httpd.conf
SetEnv PYTHON_EGG_CACHE /tmp
Luckily, a lot of other people have seen this problem, and some of them even know a bit about mod_python
A helpful google search turned up a trac mailing list post gave me the hint I needed.
Thanks to Django’s funky setup, a lot of people have discovered that mod_python doesn’t take SetEnv. I don’t know if this is a bug or a design flaw (perhaps with some justification).
Anyway here’s the hack for mod_python users, instead of SetEnv, use PythonOption:
PythonOption PYTHON_EGG_CACHE /tmp
Recent Comments