Edgewall Software
Modify

Opened 16 years ago

Last modified 14 months ago

#8006 new defect

Non-Writable Python Egg Cache Directory causes mod_fastcgi to send an error 500 with Apache 2

Reported by: nmadura@… Owned by:
Priority: normal Milestone: next-stable-1.6.x
Component: general Version: 0.11.2.1
Severity: normal Keywords: PYTHON_EGG_CACHE
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

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 $ ./trac.fcgi

The problem:

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…

  1. Maybe most importantly, if the PYTHON_EGG_CACHE location isn't writable fcgi does not display an error message with any relevant information
  2. the default PYTHON_EGG_CACHE is not being set properly on OS X 10.5.6
  3. the documentation of wiki/TracFastCgi is missing critical information

This problem is "slightly" documented at http://trac.edgewall.org/wiki/TracOnLeopardServer

Attachments (0)

Change History (6)

comment:1 by Carsten Klein <carsten.klein@…>, 15 years ago

Priority: highnormal
Severity: majornormal

a similar problem exists with other servers. it is sometimes helpful to see the server error logs or the syslog.

however, in most such cases, there is no log information at all, and, guess what, guessing helps a lot. and, after having guessed a lot, knowledge arises on what to look for in such cases in the first place ;)

besides that, i myself am sometimes also still in the sir-guess-a-lot phase ;)

jokes aside: first make sure that the account your server process runs in has write access to the location where normally the .egg-cache would be created in. this can simply be done by chown -R . authorized-user:autorized-user (if there is a similarly named group for that user) and then chmod -R 770 . after that, the server process has full access to the location. in fact, in case you are using sqlite as the backend, you already have set up the access permissions to the database file so that you can edit the data in for example the wiki without any exceptions being thrown.

comment:2 by Ryan J Ollos, 10 years ago

Milestone: next-minor-0.12.xnext-stable-1.0.x

comment:3 by Ryan J Ollos, 8 years ago

Milestone: next-stable-1.0.xnext-stable-1.2.x

Moved ticket assigned to next-stable-1.0.x since maintenance of 1.0.x is coming to a close. Please move the ticket back if it's critical to fix on 1.0.x.

comment:4 by Peter Suter, 6 years ago

Keywords: PYTHON_EGG_CACHE added

comment:5 by Ryan J Ollos, 5 years ago

Milestone: next-stable-1.2.xnext-stable-1.4.x

comment:6 by Ryan J Ollos, 14 months ago

Milestone: next-stable-1.4.xnext-stable-1.6.x

Milestone renamed

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The ticket will remain with no owner.
The ticket will be disowned.
as The resolution will be set. Next status will be 'closed'.
The owner will be changed from (none) to anonymous. Next status will be 'assigned'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.