Edgewall Software

Opened 16 years ago

Last modified 6 years ago

#7446 closed defect

Python handler error returning "500 internal server error" in browser — at Version 1

Reported by: jdc@… Owned by:
Priority: normal Milestone:
Component: general Version: 0.11
Severity: normal Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description (last modified by Christian Boos)

Hi,

I was installing Trac and got this error returned:

[Fri Jul 18 11:39:14 2008] [error] [client 192.168.2.3] PythonHandler trac.web.modpython_frontend: Traceback (most recent call last):
[Fri Jul 18 11:39:14 2008] [error] [client 192.168.2.3] PythonHandler trac.web.modpython_frontend:   File "/usr/lib64/python2.4/site-packages/mod_python/apache.py", line 299, in HandlerDispatch\n    result = object(req)
[Fri Jul 18 11:39:14 2008] [error] [client 192.168.2.3] PythonHandler trac.web.modpython_frontend:   File "/usr/lib/python2.4/site-packages/Trac-0.11-py2.4.egg/trac/web/modpython_frontend.py", line 127, in handler\n    from trac.web.main import dispatch_request
[Fri Jul 18 11:39:14 2008] [error] [client 192.168.2.3] PythonHandler trac.web.modpython_frontend:   File "/usr/lib/python2.4/site-packages/Trac-0.11-py2.4.egg/trac/web/main.py", line 47, in ?\n    from trac.web.chrome import Chrome
[Fri Jul 18 11:39:14 2008] [error] [client 192.168.2.3] PythonHandler trac.web.modpython_frontend:   File "/usr/lib/python2.4/site-packages/Trac-0.11-py2.4.egg/trac/web/chrome.py", line 40, in ?\n    from trac.util import compat, get_reporter_id, presentation, get_pkginfo, \\
[Fri Jul 18 11:39:14 2008] [error] [client 192.168.2.3] PythonHandler trac.web.modpython_frontend: ImportError: cannot import name compat

This is my code in trac.conf

<Location /trac/testproject>
        SetHandler mod_python
        PythonHandler trac.web.modpython_frontend
        PythonOption TracEnv /tcs/trac/testproject
        PythonOption TracUriRoot /trac/testproject
</Location>

<Location "/trac/testproject/login">
        AuthType Basic
        AuthName "trac"
        AuthUserFile /tcs/trac/testproject.htpasswd
        Require valid-user
</Location>

Is there any more information required to solve this problem?

Change History (1)

comment:1 by Christian Boos, 16 years ago

Description: modified (diff)
Milestone: 2.0

Well, you never know if that pastebin link will last for the few years to come… better include the actual error inline.

Chances are that your mod_python is still seeing some parts of an older (0.9 or 0.10) Trac installation.

Check your PYTHONPATH and check the following locations:

  • /usr/lib/python2.4/site-packages/Trac-0.11-py2.4.egg/trac/util/compat.py (should be there)
  • /usr/lib/python2.4/site-packages/trac (should not be there)
Note: See TracTickets for help on using tickets.