You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Graham Freeman <g-...@adfa.edu.au> on 2003/04/17 05:48:34 UTC

CGI and broken pipe exception

I have just installed Tomcat 4.1.24 on port 8080 on a Linux box, and 
have it successfully processing JSP and servlets in containers.  I have 
set up a simple CGI demonstration and enabled CGI in a container.  I am 
observing unpredictable behaviour.  Sometimes (30% of the time) the CGI 
program is called and completes successfully.  On all other occasions, 
the web page generated is

HTTP Status 500
Exception report
The server encountered an internal error () that prevented it from 
fulfilling this request.
java.io.IOException: Broken pipe
	at java.io.FileOutputStream.writeBytes(Native Method)
	at java.io.FileOutputStream.write(FileOutputStream.java:257)
	at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:69)
	at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:127)
	at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:128)
	at 
org.apache.catalina.servlets.CGIServlet$CGIRunner.run(CGIServlet.java:1683)
	at org.apache.catalina.servlets.CGIServlet.doGet(CGIServlet.java:635)
	at org.apache.catalina.servlets.CGIServlet.doPost(CGIServlet.java:597)
...

Has anyone else observed this problem and found a way around it?

I thought it might be a timing issue, and I have tried extending the 
clientInputTimeout to 900, but this has no influence on the error rate.

The only connector I am using is the tomcat4.CoyoteConnector.
The CGI servlet is org.apache.catalina.servlets.CGIServlet.
The CGI program is a 4-line shell script.
    #!/bin/sh
    echo Content-type: text/html
    echo
    echo CGI is working fine
-- 
------------------------------------------------------------------------
Dr Graham Freeman 	g-freeman@adfa.edu.au
School of Computer Science 	Phone +61-2-6268 8186
Australian Defence Force Academy 	Fax +61-2-6268 8581



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org