[Chicago] How do you troubleshoot cgi errors?

David Rock david at graniteweb.com
Mon Jul 23 06:06:44 CEST 2007

This one is driving me nuts.  I have a simple cgi interface that I
occasionally get a "CGI Error - Bad content header" message from.   It's
particularly annoying because the problem is not easily or consistently
repeatable.  I know that what's actually happening is the html being
sent is angering the html gods, but the browser contents tell me nothing
about what the actual text attempting to be processed looks like. 

I am already trying to use cgitb to catch what's happening, to no avail.
That _does_ work if a real traceback error crops up, but this appears to
be something different.  It almost looks like the script itself is not
running properly from time to time, creating a partial page.

Does anyone have any ideas about how to monitor what is actually being
generated and sent to the browser?  I'm almost to the point where I am
considering creating duplicate print statements to an external log for
everything I am printing, but that seems crazy to have to go that far.
Isn't there any way to debug/monitor cgi output?

This is a Windows Server 2003 system running IIS 6.0, if that gives
anyone any ideas (not my choice of webservers) :-(

David Rock
david at graniteweb.com

More information about the Chicago mailing list