Description

I'm trying to set up a root wiki with mod-python and unable to make it work.

Steps to reproduce

Web server config:

<VirtualHost *>
  ServerName wiki.xxx.org

  Alias /wiki/ "/usr/share/moin/htdocs/"
  Alias /favicon.ico "/var/moin/wiki/favicon.ico"
  Alias /icone.png "/var/moin/wiki/icone.png"

  RewriteEngine on
  RewriteCond %{REQUEST_URI} !^/(wiki)/
  RewriteRule ^(.*)$ /var/moin/wiki/moinmodpy.py$1

  <Directory "/var/moin/wiki/">
    AddHandler python-program .py
    PythonPath "['/var/moin/wiki'] + sys.path"
    PythonHandler moinmodpy
  </Directory>

</VirtualHost>

I get the following log from the Apache error.log file:

[Wed Nov 30 23:30:37 2005] [error] PythonHandler moinmodpy: Traceback (most recent call last):
[Wed Nov 30 23:30:37 2005] [error] PythonHandler moinmodpy:   File "/usr/lib/python2.3/site-packages/mod_python/apache.py",
 line 193, in Dispatch\n    result = object(req)
[Wed Nov 30 23:30:37 2005] [error] PythonHandler moinmodpy:   File "/var/moin/wiki/moinmodpy.py", line
57, in handler\n    moinreq = RequestModPy(request)
[Wed Nov 30 23:30:37 2005] [error] PythonHandler moinmodpy:   File "/usr/lib/python2.3/site-packages/MoinMoin/request.py",
line 1700, in __init__\n    self.fixScriptNameAndPathInfo(env)
[Wed Nov 30 23:30:37 2005] [error] PythonHandler moinmodpy:   File "/usr/lib/python2.3/site-packages/MoinMoin/request.py",
line 1721, in fixScriptNameAndPathInfo\n    location = self.mpyreq.get_options().get('Location')
[Wed Nov 30 23:30:37 2005] [error] PythonHandler moinmodpy: AttributeError: get

Example

Details

MoinMoin Version

1.3.5

OS and Version

Debian stable

Python Version

2.3.5-3sarge1

Mod python version

2.7.10

Server Setup

farm with 2 wiki

Server Details

Workaround

Discussion

   1 23:57:24 < xorAxAx> J-PGuerard: can you modify line 1721 in request.py to raise Exception(repr(self.mpyreq.get_options()))?
   2 23:57:36 < xorAxAx> J-PGuerard: simply add it in the line before
   3 00:06:16 < J-PGuerard> moinmodpy: Exception: {'Location': '/'}
   4 00:06:55 < xorAxAx> now try "raise Exception(type(self.mpyreq.get_options()))"
   5 00:08:00 < J-PGuerard> Exception: <type 'mp_table'>
   6 00:08:47 < xorAxAx> ah :)
   7 00:08:58 < xorAxAx> so mp_table is somehow broken
   8 00:09:17 < xorAxAx> now remove the new raise line and edit the location = line like this:
   9 00:09:32 < xorAxAx> .... get_options()['Location']
  10 00:09:43 < xorAxAx> (this eliminates the get)
  11 00:11:07 < J-PGuerard> "data_underlay_dir" does not exists at "./underlay/", or has incorrect  ownership and permissions.
  12 00:12:36 < xorAxAx> very nice, so this fixed the bug

Plan


CategoryMoinMoinBugFixed

MoinMoin: MoinMoinBugs/ModPyUnableToSetUpARootWiki (last edited 2007-10-29 19:15:52 by localhost)