Description

Creating a new page fails when installed on IIS.

NOTE: This is a duplicate, see MoinMoinBugs/CantCreateEmptyPageHostedOnIis

The solution is to reset the behaviour of IIS on 404 errors to default, see HelpOnInstalling/InternetInformationServer, the section starting with "Starting with MoinMoin 1.3.5".

Steps to reproduce

  1. Install MoinMoin on Windows using IIS

  2. Configure it
  3. Open the frontpage
  4. Edit the frontpage and add a link to a non-existing page: ["nonexisting page"]

  5. Save the change
  6. Click on the new link
  7. You get an 404 error rather than the option to create the page

Example

see above

Details

This error can be found in the data directory's error.log file:

IOError: [Errno 22] Invalid argument
[Fri May 26 12:31:54 2006] IOError: [Errno 22] Invalid argument
Traceback (most recent call last):
  File "C:\moin\icdwiki\moin.cgi", line 43, in ?
    request.run()
  File "c:/moin/lib/site-packages\MoinMoin\request.py", line 1129, in run
    self.fail(err)
  File "c:/moin/lib/site-packages\MoinMoin\request.py", line 1163, in fail
    failure.handle(self)             
  File "c:/moin/lib/site-packages\MoinMoin\failure.py", line 145, in handle
    request.write('<pre>\n')
  File "c:/moin/lib/site-packages\MoinMoin\request.py", line 1427, in write
    sys.stdout.write(self.encode(data))
IOError: [Errno 22] Invalid argument

Workaround

I have added the following line to moin.cgi:

## ...

from MoinMoin.request import RequestCGI
request = RequestCGI()

## added this line
sys.stdout.write('bugfix')

request.run()

## ...

I have no idea why it works, but it does. Apparently it initializes the standard output somehow. Writing an empty string or a space does not work.

Another workaround is to just return 200 for non-existing wiki pages:

## Page.py:
#...
        # start document output
        doc_leader = self.formatter.startDocument(self.page_name)
        page_exists = self.exists()
        if not content_only:
            request.setHttpHeader("Content-Type: %s; charset=%s" % ('text/html', config.charset))
            if page_exists:
                #...
            else:
                #request.setHttpHeader('Status: 404 NOTFOUND')
                #request.setResponseCode(404)
                request.setHttpHeader('Status: 200 OK')

Discussion

This is not a MoinMoin bug, please refer to the IIS installation instructions for working around this IIS bug.

Plan


CategoryMoinMoinNoBug

MoinMoin: MoinMoinBugs/CreatePageFailsOnIis (last edited 2007-10-29 19:09:21 by localhost)