Re: All responses are 200 (server error)

2010-09-27 Thread Peter Janovsky
Are you returning the value of 200 within a module you've written?  I 
encountered a similar issue within a C module specific to valid requests. It 
was resolved by returning the internal constant OK. 



On Sep 27, 2010, at 5:27, Nico Coetzee  wrote:

> Hi - don't know if anybody else have come across this.
> 
> I have a mod_perl instance that produces output just as it should (checked in 
> the logs and I even written the output to file just to have an extra check).
> 
> The tcpdump also show everything is ok.
> 
> BUT
> 
> The content has the following HTML appended at the end:
> 
> 
> 
> 200 OK
> 
> OK
> The server encountered an internal error or
> misconfiguration and was unable to complete
> your request.
> Please contact the server administrator,
>  webmas...@host.example.com and inform them of the time the error occurred,
> and anything you might have done that may have
> caused the error.
> More information about this error may be available
> in the server error log.
> 
> Apache/2.2.3 (CentOS) Server at webdavtest Port 81
> 
> 
> So, I've enabled "debug" level logging everywhere and even enabled 
> diagnostics in the mod_perl script. Nothing strange shows up anywhere.
> 
> I even tried to change the return code with return Apache2::Const::XXX (XXX 
> could be anything) but the return code is ALWAYS 200 with the above HTML 
> appended to what ever output is sent to the browser.
> 
> I also noted that the content length header is correct for the content sent 
> to the browser and does not include the additional HTML above, but it still 
> confuses the browser.
> 
> Any ideas?
> 
> Environment:
> 
> CentOS 5.5 OS with the following packages:
> 
> * httpd-2.2.3-43.el5.centos.3
> * mod_perl-2.0.4-6.el5
> 
> In my config I have the following enabled:
> 
> * LogLevel debug
> * PerlWarn On
> 
> Thanks
> 
> Nico


Re: All responses are 200 (server error)

2010-10-01 Thread William A. Rowe Jr.
On 9/27/2010 6:09 AM, Peter Janovsky wrote:
> Are you returning the value of 200 within a module you've written?  I 
> encountered a
> similar issue within a C module specific to valid requests. It was resolved 
> by returning
> the internal constant OK. 

This is a generalized issue of serving ErrorDocuments; if they have a Status/
result code update (such as a backend proxy response or a cgi response), that
will override the original error code.  c.f.
https://issues.apache.org/bugzilla/show_bug.cgi?id=49996

So it is not strictly a bug, but you certainly aren't the first to be frustrated
by the behavior; look to the manner you handle ErrorDocuments with, first.