Description

MoinMoin + lighttpd + FastCGI fills the lighttpd error log with empty messages.

Steps to reproduce

  1. Install MoinMoin per Deploying on lighttpd under HelpOnInstalling/FastCgi

  2. Every request will cause an error message in the lighttpd error log such as:
    2006-07-25 23:55:17: (mod_fastcgi.c.2536) FastCGI-stderr:  
    2006-07-25 23:55:19: (mod_fastcgi.c.2536) FastCGI-stderr:  
    2006-07-25 23:55:26: (mod_fastcgi.c.2536) FastCGI-stderr:  
    2006-07-25 23:55:28: (mod_fastcgi.c.2536) FastCGI-stderr:  
    This is actually noted on the aforementioned installation page.

Example

Details

MoinMoin Version

1.5.4

OS and Version

Red Hat 7.3

Python Version

2.4.3

Server Setup

lighttpd-1.4.11

Server Details

mod_fastcgi

Language you are using the wiki in

English

Workaround

This is a bug in lighttpd's mod_fastcgi.c (see below). In the meantime, the following change to thfcgi.py silences the empty messages:

--- /home/jay/src/moin-1.5.4/MoinMoin/support/thfcgi.py Thu May 11 16:24:00 2006
+++ lib/python2.4/site-packages/MoinMoin/support/thfcgi.py      Wed Jul 26 00:26:20 2006
@@ -322,17 +322,18 @@
         self.have_finished = 1
 
         # stderr
-        self.err.reset()
-        rec = Record()
-        rec.rec_type = FCGI_STDERR
-        rec.req_id = self.req_id
-        data = self.err.read()
-        while data:
-            chunk, data = self.getNextChunk(data)
-            rec.content = chunk
-            rec.writeRecord(self.conn)
-        rec.content = ""
-        rec.writeRecord(self.conn)      # Terminate stream
+        if self.err.tell():
+            self.err.reset()
+            rec = Record()
+            rec.rec_type = FCGI_STDERR
+            rec.req_id = self.req_id
+            data = self.err.read()
+            while data:
+                chunk, data = self.getNextChunk(data)
+                rec.content = chunk
+                rec.writeRecord(self.conn)
+            rec.content = ""
+            rec.writeRecord(self.conn)      # Terminate stream
 
         # stdout
         self.out.reset()

thfcgi.py-stderr.patch

Discussion

I believe this to a be a bug in lighttpd's mod_fastcgi module and have filed it as so:

In the interim, modifying thfcgi.py to not send an zero-length FCGI_STDERR record also fixes the problem.

Plan


CategoryMoinMoinBugFixed

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