Description

I got errors with the Despam action. I have just installed 1.5beta5 on Apache. The bug appears on with both fastCGI and regular CGI, though with different error messages.

You get a 500 -- internal server error. It happens after checking of credentials, if you are not logged in it properly displays the error message.

Apache fails with this message in the error log, upon attempting the Despam action on any page.

regular cgi:

[Tue Dec 13 18:47:50 2005] [error] [client xxxxx ] malformed header from script. Bad header=<html>: /srv/www/moin/moin.cgi

fastcgi:

[Tue Dec 13 16:34:45 2005] [error] [client xxxx ] FastCGI: comm with server "/srv/www/moin/moin.fcgi" aborted: error parsing headers: malformed header '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http //www.w3.org/TR/html4/strict.dtd">'

Steps to reproduce

  1. Attempt Despam action on any page in a wiki set up like described above I will fill in more details later, if not resolved via IRC

Example

Details

1.5.0beta5

Linux lefschetz 2.6.8.12004818 #1 Wed Aug 18 11:45:14 CDT 2004 i686 GNU/Linux

Python 2.4.1

Apache / fastCGI or regular CGI (both tested)

Server Details

Workaround

This patch makes it work for me, but I know it's not complete. Hopefully it points someone in the right direction. Despam works with an identical version on moinmoin.....de, but that's running twisted instead of apache.

This patch works ONLY for cgi, not fastcgi.

--- /home/richard/root/moin-1.5.0beta5/MoinMoin/action/Despam.py        2005-11-21 03:35:34.000000000 -0600
+++ action/Despam.py    2005-12-13 19:06:01.921588842 -0600
@@ -158,6 +158,12 @@
 
 def execute(pagename, request):
     _ = request.getText
+    #####
+    # This is not the correct answer, but hopefully it will provide
+    # someone with the information needed to fix it.
+    print "Content-Type: text/html;charset=utf-8"
+    print
+    #####
     # be extra paranoid in dangerous actions
     actname = __name__.split('.')[-1]
     if actname in request.cfg.actions_excluded or \

Better try this:

--- orig/MoinMoin/action/Despam.py
+++ mod/MoinMoin/action/Despam.py
@@ -170,6 +170,7 @@
        # request.form.get('timestamp', [None])[0]
     ok = request.form.get('ok', [0])[0]
 
+    request.http_headers()
     wikiutil.send_title(request, "Despam", pagename=pagename)    
     # Start content (important for RTL support)
     request.write(request.formatter.startContent("content"))

Discussion

Plan


CategoryMoinMoinBugFixed

MoinMoin: MoinMoinBugs/DespamActionDoesNotPrintHTTPHeaders (last edited 2007-10-29 19:07:48 by localhost)