Description
MoinMoin + lighttpd + FastCGI fills the lighttpd error log with empty messages.
Steps to reproduce
Install MoinMoin per Deploying on lighttpd under HelpOnInstalling/FastCgi
- 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
- See above.
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()
Discussion
I believe this to a be a bug in lighttpd's mod_fastcgi module and have filed it as so:
http://trac.lighttpd.net/trac/ticket/766
- According to the FastCGI Specification:
- If an application has no errors to report, it sends either no FCGI_STDERR records or one zero-length FCGI_STDERR record.
See section 6.1 Role Protocols - http://www.fastcgi.com/devkit/doc/fcgi-spec.html
- According to the FastCGI Specification:
In the interim, modifying thfcgi.py to not send an zero-length FCGI_STDERR record also fixes the problem.
Plan
- Priority:
- Assigned to:
- Status: Committed as 8c8b63ad1d17, thanks Jay!