You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Kate Yoak <ka...@yoak.com> on 2007/12/29 20:14:02 UTC

Internal Server Error output - but no error

I am using mp2bug format for the message.  Hope, that's ok!


=========================
-------------8<---------- Start Bug Report ------------8<----------
1. Problem Description:


I have just upgraded to apache2/modperl2 (bug report with specific  
version info is below) and I am getting the strangest behavior. The  
barebones content handler:

sub handler{
	return 200;
}

Generates the proper headers:
HTTP/1.1 200 OK
Date: Sun, 30 Dec 2007 03:12:03 GMT
Server: Apache/2.2.6 (Unix) mod_perl/2.0.3 Perl/v5.8.8
Content-Length: 497
Content-Type: text/html; charset=iso-8859-1

But then adds a 500 error html to the output:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>200 OK</title>
</head><body>
<h1>OK</h1>
<p>The server encountered an internal error or
misconfiguration and was unable to complete
your request.</p>
<p>Please contact the server administrator,
  you@example.com and inform them of the time the error occurred,
and anything you might have done that may have
caused the error.</p>
<p>More information about this error may be available
in the server error log.</p>
</body></html>


I say, "adds" because I have verified that if any content is output  
by the handler, the 500 doc is appended.

There is no error in the error log.

Interestingly, a 302 result works correctly. A static page display is  
fine also. I have rebuilt perl & mod_perl since I encountered the  
error to no avail.

I have tested with no modules loaded into apache - and with template  
toolkit - which appears to be working correctly except for the  
problem above. I compiled mod_perl as a dso; no threads; everything  
else default.

Thanks for the help:


2. Used Components and their Configuration:

*** mod_perl version 2.000003

*** using /tmp/mod_perl-2.0.3/lib/Apache2/BuildConfig.pm

*** Makefile.PL options:
   MP_APR_LIB     => aprext
   MP_APXS        => /usr/sbin/apxs
   MP_COMPAT_1X   => 1
   MP_GENERATE_XS => 1
   MP_LIBNAME     => mod_perl
   MP_USE_DSO     => 1


*** /usr/sbin/httpd -V
Server version: Apache/2.2.6 (Unix)
Server built:   Dec 28 2007 00:27:39
Server's Module Magic Number: 20051115:5
Server loaded:  APR 1.2.11, APR-Util 1.2.10
Compiled using: APR 1.2.11, APR-Util 1.2.10
Architecture:   32-bit
Server MPM:     Prefork
   threaded:     no
     forked:     yes (variable process count)
Server compiled with....
  -D APACHE_MPM_DIR="server/mpm/prefork"
  -D APR_HAS_SENDFILE
  -D APR_HAS_MMAP
  -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
  -D APR_USE_SYSVSEM_SERIALIZE
  -D APR_USE_PTHREAD_SERIALIZE
  -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
  -D APR_HAS_OTHER_CHILD
  -D AP_HAVE_RELIABLE_PIPED_LOGS
  -D DYNAMIC_MODULE_LIMIT=128
  -D HTTPD_ROOT="/usr"
  -D SUEXEC_BIN="/usr/bin/suexec"
  -D DEFAULT_PIDLOG="/var/run/httpd.pid"
  -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
  -D DEFAULT_LOCKFILE="/var/run/accept.lock"
  -D DEFAULT_ERRORLOG="logs/error_log"
  -D AP_TYPES_CONFIG_FILE="/etc/httpd/conf/mime.types"
  -D SERVER_CONFIG_FILE="/etc/httpd/conf/httpd.conf"

*** /usr/bin/ldd /usr/sbin/httpd
	linux-gate.so.1 =>  (0x00e17000)
	libm.so.6 => /lib/libm.so.6 (0x00c9e000)
	libaprutil-1.so.0 => /usr/lib/libaprutil-1.so.0 (0x00388000)
	libpq.so.4 => /usr/lib/libpq.so.4 (0x002b2000)
	libsqlite3.so.0 => /usr/lib/libsqlite3.so.0 (0x005ae000)
	libexpat.so.0 => /usr/lib/libexpat.so.0 (0x00766000)
	libapr-1.so.0 => /usr/lib/libapr-1.so.0 (0x00365000)
	libuuid.so.1 => /lib/libuuid.so.1 (0x003ae000)
	librt.so.1 => /lib/librt.so.1 (0x003f0000)
	libcrypt.so.1 => /lib/libcrypt.so.1 (0x00cee000)
	libpthread.so.0 => /lib/libpthread.so.0 (0x00cda000)
	libdl.so.2 => /lib/libdl.so.2 (0x00c98000)
	libc.so.6 => /lib/libc.so.6 (0x00b6d000)
	/lib/ld-linux.so.2 (0x00b4f000)
	libssl.so.5 => /lib/libssl.so.5 (0x00d95000)
	libcrypto.so.5 => /lib/libcrypto.so.5 (0x00101000)
	libkrb5.so.3 => /usr/lib/libkrb5.so.3 (0x00210000)
	libresolv.so.2 => /lib/libresolv.so.2 (0x00d1e000)
	libnsl.so.1 => /lib/libnsl.so.1 (0x00d33000)
	libgssapi_krb5.so.2 => /usr/lib/libgssapi_krb5.so.2 (0x00d50000)
	libcom_err.so.2 => /lib/libcom_err.so.2 (0x00d4b000)
	libk5crypto.so.3 => /usr/lib/libk5crypto.so.3 (0x00d6a000)
	libz.so.1 => /usr/lib/libz.so.1 (0x00cc5000)
	libkrb5support.so.0 => /usr/lib/libkrb5support.so.0 (0x00d90000)


*** (apr|apu)-config linking info

  -L/usr/lib -laprutil-1 -lpq -lsqlite3 -lexpat
  -L/usr/lib -lapr-1 -luuid -lrt -lcrypt  -lpthread -ldl



*** /usr/bin/perl -V
Summary of my perl5 (revision 5 version 8 subversion 8) configuration:
   Platform:
     osname=linux, osvers=2.6.14-1.1653_fc4smp, archname=i686-linux
     uname='linux nat.longmedia.com 2.6.14-1.1653_fc4smp #1 smp tue  
dec 13 21:46:01 est 2005 i686 i686 i386 gnulinux '
     config_args=''
     hint=recommended, useposix=true, d_sigaction=define
     usethreads=undef use5005threads=undef useithreads=undef  
usemultiplicity=undef
     useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
     use64bitint=undef use64bitall=undef uselongdouble=undef
     usemymalloc=n, bincompat5005=undef
   Compiler:
     cc='gcc', ccflags ='-fno-strict-aliasing -pipe -Wdeclaration- 
after-statement -I/usr/local/include -D_LARGEFILE_SOURCE - 
D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm',
     optimize='-O2',
     cppflags='-fno-strict-aliasing -pipe -Wdeclaration-after- 
statement -I/usr/local/include -I/usr/include/gdbm'
     ccversion='', gccversion='4.0.2 20051125 (Red Hat 4.0.2-8)',  
gccosandvers=''
     intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
     d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
     ivtype='long', ivsize=4, nvtype='double', nvsize=8,  
Off_t='off_t', lseeksize=8
     alignbytes=4, prototype=define
   Linker and Libraries:
     ld='gcc', ldflags =' -L/usr/local/lib'
     libpth=/usr/local/lib /lib /usr/lib
     libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc
     perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc
     libc=/lib/libc-2.3.5.so, so=so, useshrplib=true, libperl=libperl.so
     gnulibc_version='2.3.5'
   Dynamic Linking:
     dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E  
-Wl,-rpath,/usr/lib/perl5/5.8.8/i686-linux/CORE'
     cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'


Characteristics of this binary (from libperl):
   Compile-time options: PERL_MALLOC_WRAP USE_LARGE_FILES USE_PERLIO
   Built under linux
   Compiled at Dec 29 2007 18:07:25
   %ENV:
     PERL5LIB="/long/modules"
     PERL_LWP_USE_HTTP_10="1"
   @INC:
     /long/modules
     /usr/lib/perl5/5.8.8/i686-linux
     /usr/lib/perl5/5.8.8
     /usr/lib/perl5/site_perl/5.8.8/i686-linux
     /usr/lib/perl5/site_perl/5.8.8
     /usr/lib/perl5/site_perl
     .

*** Packages of interest status:

Apache2            : -
Apache2::Request   : -
CGI                : 3.15
ExtUtils::MakeMaker: 6.30
LWP                : -
mod_perl           : -
mod_perl2          : 2.000003


3. This is the core dump trace: (if you get a core dump):

   [CORE TRACE COMES HERE]

This report was generated by /usr/bin/mp2bug on Sun Dec 30 03:19:48  
2007 GMT.

-------------8<---------- End Bug Report --------------8<----------

Note: Complete the rest of the details and post this bug report to
modperl <at> perl.apache.org. To subscribe to the list send an empty
email to modperl-subscribe@perl.apache.org.



Re: [bugreport] Internal Server Error output - but no error

Posted by Perrin Harkins <pe...@elem.com>.
On Dec 30, 2007 3:45 PM, Kate Yoak <ka...@yoak.com> wrote:
> returning 200 as a scalar from a content handler causes Apache to
> spit up "Internal Server Error" html despite a '200 OK'  status.
> There is no error or warning in the log, nor any other indication of
> a problem

This is more of an apache thing than a mod_perl thing.  The return
from a handler is not an HTTP status code but rather a code to tell
apache if the handler succeeded.  The HTTP status is set through the
Apache2::RequestRec object or sent manually as a header.  None of this
is changed by mod_perl, which just passes your return code through to
apache like any handler would.

- Perrin

Re: [bugreport] Internal Server Error output - but no error

Posted by Kate Yoak <ka...@yoak.com>.
I have solved the problem. I was returning 200 instead of using  
Apache2::Const::OK. My response was indeed interpreted as 'OK" by  
apache - but not by some place somewhere else. There was no error  
message anywhere. I'll modify the bugreport below to have it  
addressed or not at the maintainers' discretion.
On Dec 29, 2007, at 11:14 AM, Kate Yoak wrote:

> I am using mp2bug format for the message.  Hope, that's ok!
>
>
> =========================
> -------------8<---------- Start Bug Report ------------8<----------
> 1. Problem Description:

returning 200 as a scalar from a content handler causes Apache to  
spit up "Internal Server Error" html despite a '200 OK'  status.  
There is no error or warning in the log, nor any other indication of  
a problem

> sub handler{
> 	return 200;
> }
>
> Generates the proper headers:
> HTTP/1.1 200 OK
> Date: Sun, 30 Dec 2007 03:12:03 GMT
> Server: Apache/2.2.6 (Unix) mod_perl/2.0.3 Perl/v5.8.8
> Content-Length: 497
> Content-Type: text/html; charset=iso-8859-1
>
> But then adds a 500 error html to the output:
> <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
> <html><head>
> <title>200 OK</title>
> </head><body>
> <h1>OK</h1>
> <p>The server encountered an internal error or
> misconfiguration and was unable to complete
> your request.</p>
> <p>Please contact the server administrator,
>  you@example.com and inform them of the time the error occurred,
> and anything you might have done that may have
> caused the error.</p>
> <p>More information about this error may be available
> in the server error log.</p>
> </body></html>
>
>
> Interestingly, a 302 result works correctly. A static page display  
> is fine also. I have rebuilt perl & mod_perl since I encountered  
> the error to no avail.
>
> 2. Used Components and their Configuration:
>
> *** mod_perl version 2.000003
>
> *** using /tmp/mod_perl-2.0.3/lib/Apache2/BuildConfig.pm
>
> *** Makefile.PL options:
>   MP_APR_LIB     => aprext
>   MP_APXS        => /usr/sbin/apxs
>   MP_COMPAT_1X   => 1
>   MP_GENERATE_XS => 1
>   MP_LIBNAME     => mod_perl
>   MP_USE_DSO     => 1
>
>
> *** /usr/sbin/httpd -V
> Server version: Apache/2.2.6 (Unix)
> Server built:   Dec 28 2007 00:27:39
> Server's Module Magic Number: 20051115:5
> Server loaded:  APR 1.2.11, APR-Util 1.2.10
> Compiled using: APR 1.2.11, APR-Util 1.2.10
> Architecture:   32-bit
> Server MPM:     Prefork
>   threaded:     no
>     forked:     yes (variable process count)
> Server compiled with....
>  -D APACHE_MPM_DIR="server/mpm/prefork"
>  -D APR_HAS_SENDFILE
>  -D APR_HAS_MMAP
>  -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
>  -D APR_USE_SYSVSEM_SERIALIZE
>  -D APR_USE_PTHREAD_SERIALIZE
>  -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
>  -D APR_HAS_OTHER_CHILD
>  -D AP_HAVE_RELIABLE_PIPED_LOGS
>  -D DYNAMIC_MODULE_LIMIT=128
>  -D HTTPD_ROOT="/usr"
>  -D SUEXEC_BIN="/usr/bin/suexec"
>  -D DEFAULT_PIDLOG="/var/run/httpd.pid"
>  -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
>  -D DEFAULT_LOCKFILE="/var/run/accept.lock"
>  -D DEFAULT_ERRORLOG="logs/error_log"
>  -D AP_TYPES_CONFIG_FILE="/etc/httpd/conf/mime.types"
>  -D SERVER_CONFIG_FILE="/etc/httpd/conf/httpd.conf"
>
> *** /usr/bin/ldd /usr/sbin/httpd
> 	linux-gate.so.1 =>  (0x00e17000)
> 	libm.so.6 => /lib/libm.so.6 (0x00c9e000)
> 	libaprutil-1.so.0 => /usr/lib/libaprutil-1.so.0 (0x00388000)
> 	libpq.so.4 => /usr/lib/libpq.so.4 (0x002b2000)
> 	libsqlite3.so.0 => /usr/lib/libsqlite3.so.0 (0x005ae000)
> 	libexpat.so.0 => /usr/lib/libexpat.so.0 (0x00766000)
> 	libapr-1.so.0 => /usr/lib/libapr-1.so.0 (0x00365000)
> 	libuuid.so.1 => /lib/libuuid.so.1 (0x003ae000)
> 	librt.so.1 => /lib/librt.so.1 (0x003f0000)
> 	libcrypt.so.1 => /lib/libcrypt.so.1 (0x00cee000)
> 	libpthread.so.0 => /lib/libpthread.so.0 (0x00cda000)
> 	libdl.so.2 => /lib/libdl.so.2 (0x00c98000)
> 	libc.so.6 => /lib/libc.so.6 (0x00b6d000)
> 	/lib/ld-linux.so.2 (0x00b4f000)
> 	libssl.so.5 => /lib/libssl.so.5 (0x00d95000)
> 	libcrypto.so.5 => /lib/libcrypto.so.5 (0x00101000)
> 	libkrb5.so.3 => /usr/lib/libkrb5.so.3 (0x00210000)
> 	libresolv.so.2 => /lib/libresolv.so.2 (0x00d1e000)
> 	libnsl.so.1 => /lib/libnsl.so.1 (0x00d33000)
> 	libgssapi_krb5.so.2 => /usr/lib/libgssapi_krb5.so.2 (0x00d50000)
> 	libcom_err.so.2 => /lib/libcom_err.so.2 (0x00d4b000)
> 	libk5crypto.so.3 => /usr/lib/libk5crypto.so.3 (0x00d6a000)
> 	libz.so.1 => /usr/lib/libz.so.1 (0x00cc5000)
> 	libkrb5support.so.0 => /usr/lib/libkrb5support.so.0 (0x00d90000)
>
>
> *** (apr|apu)-config linking info
>
>  -L/usr/lib -laprutil-1 -lpq -lsqlite3 -lexpat
>  -L/usr/lib -lapr-1 -luuid -lrt -lcrypt  -lpthread -ldl
>
>
>
> *** /usr/bin/perl -V
> Summary of my perl5 (revision 5 version 8 subversion 8) configuration:
>   Platform:
>     osname=linux, osvers=2.6.14-1.1653_fc4smp, archname=i686-linux
>     uname='linux nat.longmedia.com 2.6.14-1.1653_fc4smp #1 smp tue  
> dec 13 21:46:01 est 2005 i686 i686 i386 gnulinux '
>     config_args=''
>     hint=recommended, useposix=true, d_sigaction=define
>     usethreads=undef use5005threads=undef useithreads=undef  
> usemultiplicity=undef
>     useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
>     use64bitint=undef use64bitall=undef uselongdouble=undef
>     usemymalloc=n, bincompat5005=undef
>   Compiler:
>     cc='gcc', ccflags ='-fno-strict-aliasing -pipe -Wdeclaration- 
> after-statement -I/usr/local/include -D_LARGEFILE_SOURCE - 
> D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm',
>     optimize='-O2',
>     cppflags='-fno-strict-aliasing -pipe -Wdeclaration-after- 
> statement -I/usr/local/include -I/usr/include/gdbm'
>     ccversion='', gccversion='4.0.2 20051125 (Red Hat 4.0.2-8)',  
> gccosandvers=''
>     intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
>     d_longlong=define, longlongsize=8, d_longdbl=define,  
> longdblsize=12
>     ivtype='long', ivsize=4, nvtype='double', nvsize=8,  
> Off_t='off_t', lseeksize=8
>     alignbytes=4, prototype=define
>   Linker and Libraries:
>     ld='gcc', ldflags =' -L/usr/local/lib'
>     libpth=/usr/local/lib /lib /usr/lib
>     libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc
>     perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc
>     libc=/lib/libc-2.3.5.so, so=so, useshrplib=true,  
> libperl=libperl.so
>     gnulibc_version='2.3.5'
>   Dynamic Linking:
>     dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,- 
> E -Wl,-rpath,/usr/lib/perl5/5.8.8/i686-linux/CORE'
>     cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'
>
>
> Characteristics of this binary (from libperl):
>   Compile-time options: PERL_MALLOC_WRAP USE_LARGE_FILES USE_PERLIO
>   Built under linux
>   Compiled at Dec 29 2007 18:07:25
>   %ENV:
>     PERL5LIB="/long/modules"
>     PERL_LWP_USE_HTTP_10="1"
>   @INC:
>     /long/modules
>     /usr/lib/perl5/5.8.8/i686-linux
>     /usr/lib/perl5/5.8.8
>     /usr/lib/perl5/site_perl/5.8.8/i686-linux
>     /usr/lib/perl5/site_perl/5.8.8
>     /usr/lib/perl5/site_perl
>     .
>
> *** Packages of interest status:
>
> Apache2            : -
> Apache2::Request   : -
> CGI                : 3.15
> ExtUtils::MakeMaker: 6.30
> LWP                : -
> mod_perl           : -
> mod_perl2          : 2.000003
>
>
> 3. This is the core dump trace: (if you get a core dump):
>
>   [CORE TRACE COMES HERE]
>
> This report was generated by /usr/bin/mp2bug on Sun Dec 30 03:19:48  
> 2007 GMT.
>
> -------------8<---------- End Bug Report --------------8<----------
>
> Note: Complete the rest of the details and post this bug report to
> modperl <at> perl.apache.org. To subscribe to the list send an empty
> email to modperl-subscribe@perl.apache.org.
>
>