in reply to Request returns "200 OK", reports internal server error. [solved]

It just means you had already sent the header when the error occurred. My guess about the nature of the error is that you didn't import Apache2::Const::OK and that "OK" is just a string. That's not what apache wants to see.
  • Comment on Re: Request returns "200 OK", reports internal server error.

Replies are listed 'Best First'.
Re^2: Request returns "200 OK", reports internal server error.
by kyle (Abbot) on Sep 18, 2008 at 18:33 UTC

    Thanks for your comment! The code in question has in it:

    use Apache::Constants qw( OK REDIRECT etc. );

    Also, this is only triggered in a special case. That is, something like this:

    sub general_request_handler { # do the usual stuff if ( $r->param( 'special' ) ) { # go off and do something special } # etc. }

    We're taking the same path otherwise, and the "return OK" is fine there, so I don't think that's the problem here. Also, it doesn't happen every time the special case is used, only for certain users, certain data sets.

    Thanks again.

      Well, the word "OK" in your error response is very suspicious. Try adding a warn to log the value of OK, and try making that sub return "OK()" to force the call to the imported sub.

        I did this:

        $ find lib -type f -name \*.pm -print|xargs perl -pi.bak -e 's/return +OK/return OK()/'

        (That was pretty fun.)

        I'm still getting the same results. Thanks again for your suggestions.

        P. S. — I did this to put it all back:

        find lib -name \*.bak -print|perl -lne 'chomp;$f=$_;s/\.bak$//;print " +mv -v $f $_"'|sh