Trac problem: AttributeError: Cannot find an implementation of the "IRequestHandler" interface named "WikiModule"

Posted by Janosch on Server Fault See other posts from Server Fault or by Janosch
Published on 2011-04-15T10:45:00Z Indexed on 2012/06/26 21:18 UTC
Read the original article Hit count: 562

Filed under:
|
|
|

This problem already has been described mutliple times in different mailing lists, but no solution has yet been published.

My original setup is as follows (but in the mean time i have a simpler one on Windows 7):

  • Ubuntu server with apache 2.2 and python 2.7
  • virutal python environment created with virtualenv
  • installed babel, genshi and trac in this order using pip in the virtual environment

Trac seems to run fine with tracd, but when visiting it through apache, i get the following error in an official trac error page:

AttributeError: Cannot find an implementation of the "IRequestHandler" interface named "WikiModule"

The stacktrace looks like this:

Traceback (most recent call last):
 File "/srv/trac/python-environment/lib/python2.5/site-packages/Trac-0.13dev_r10668-py2.5.egg/trac/web/main.py",line 473, in _dispatch_request
   dispatcher.dispatch(req)
 File "/srv/trac/python-environment/lib/python2.5/site-packages/Trac-0.13dev_r10668-py2.5.egg/trac/web/main.py", line 154, in dispatch
   chosen_handler = self.default_handler
 File "/srv/trac/python-environment/lib/python2.5/site-packages/Trac-0.13dev_r10668-py2.5.egg/trac/config.py", line 691, in __get__
   self.section, self.name))
AttributeError: Cannot find an implementation of the "IRequestHandler" interface named "WikiModule".  Please update the option trac.default_handler in trac.ini.

I already tried a lot to get down to the root of the problem, for me it looks as if all nativ trac components refuse to load. When one explicitely imports these components in the wsgi handler, some of them start to work somehow.

Since i suspected the virtual environment, i dropped it, and manually copied all dependencies (babel, genshi, trac, ..) to one directory, and added this directory to system.path in the wsgi handler. I get exactly the same error. Since this setup is now independend from the environment, one can easily try it out on any other machine (windows or linux) running apache 2 and python 2.7. On my Windwos 7 machine, i got exactly the same problem.

I zipped together the whole bundle, one can download it from http://www.xterity.de/tmp/trac-installation.zip .

In the apache configuration (Windows 7 machine) i use the following settings:

Alias /trac/chrome/common "D:/workspace/trac-installation/trac-resources/common"
Alias /trac/chrome/site "D:/workspace/trac-installation/trac-resources/site"

WSGIScriptAlias /trac "D:/workspace/trac-installation/apache/handler.wsgi"

<Directory "D:/workspace/trac-installation/trac-resources">
     Order allow,deny
     Allow from all
</Directory>

<Directory "D:/workspace/trac-installation">
     Order allow,deny
     Allow from all
</Directory>

<Location "/trac">
 Order allow,deny
 Allow from all
</Location>

And my handler.wsgi looks like this:

import os
import sys

sys.path.append('D:/workspace/trac-installation/dependencies/')

os.environ['TRAC_ENV'] = 'D:/workspace/trac-installation/trac-environments/Esp004'
os.environ['PYTHON_EGG_CACHE'] = 'D:/workspace/trac-installation/eggs'

import trac.web.main
application = trac.web.main.dispatch_request

Has anybody got an idea what could be the problem, or how to find out where it comes from?

© Server Fault or respective owner

Related posts about apache2

Related posts about python