Edgewall Software
Modify

Ticket #7446 (closed defect: invalid)

Opened 4 years ago

Last modified 4 years ago

Python handler error returning "500 internal server error" in browser

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

Description (last modified by cboos) (diff)

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?

Attachments

Change History

comment:1 follow-up: Changed 4 years ago by cboos

  • Description modified (diff)
  • Milestone 2.0 deleted

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)

comment:2 in reply to: ↑ 1 Changed 4 years ago by anonymous

Replying to cboos:

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)

Hi, thanks for the fast response and integrating the error inline.

The install on this box is fresh so it's impossible mod_python is still seeing parts of an older installation. I have also checked PYTHONPATH and it looks okay. I checked the directories as you suggested and everything looks like it should be.

Do you know any other things that could cause this error?

Thanks,
Jasper

comment:3 Changed 4 years ago by cboos

  • Resolution set to invalid
  • Status changed from new to closed

Do you know any other things that could cause this error?

No, sorry. You should better ask on the mailing list then (as for installation issues in general - hence closing the ticket).

comment:4 Changed 4 years ago by anonymous

Looks like the problem solved itself... I don't receive the errors anymore and everything seems to work just fine!

comment:5 Changed 4 years ago by cboos

Just noticed that related thread on Trac-users today: googlegroups:trac-users:f0a0ba4fc955a0a4

Not sure what the exact problem is, but seems to be related to the presence of another compat.py file (source:trunk/trac/tests/functional/compat.py).

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
to The owner will be changed from (none). Next status will be 'closed'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.