http://www.perlmonks.org?node_id=1004794

ubertricep has asked for the wisdom of the Perl Monks concerning the following question:

I'm running Ubuntu 10.04.4 (the latest), Perl v5.10.1 (the latest on this distro) and Apache/2.2.14 (Ubuntu). In /var/log/apache2/error.log I am seeing these errors:

Constant subroutine ModPerl::ROOT::ModPerl::PerlRun::home_user_public_ +html_index_2ecgi::RC_MULTIPLE_CHOICES redefined at /usr/lib/perl5/Mod +Perl/Util.pm line 69. Constant subroutine ModPerl::ROOT::ModPerl::PerlRun::home_user_public_ +html_index_2ecgi::RC_ALREADY_REPORTED redefined at /usr/lib/perl5/Mod +Perl/Util.pm line 69. Constant subroutine ModPerl::ROOT::ModPerl::PerlRun::home_user_public_ +html_index_2ecgi::RC_NO_CONTENT redefined at /usr/lib/perl5/ModPerl/U +til.pm line 69. Constant subroutine ModPerl::ROOT::ModPerl::PerlRun::home_user_public_ +html_index_2ecgi::RC_MOVED_TEMPORARILY redefined at /usr/lib/perl5/Mo +dPerl/Util.pm line 69. Constant subroutine ModPerl::ROOT::ModPerl::PerlRun::home_user_public_ +html_index_2ecgi::RC_CONFLICT redefined at /usr/lib/perl5/ModPerl/Uti +l.pm line 69. Constant subroutine ModPerl::ROOT::ModPerl::PerlRun::home_user_public_ +html_index_2ecgi::RC_VARIANT_ALSO_NEGOTIATES redefined at /usr/lib/pe +rl5/ModPerl/Util.pm line 69. Constant subroutine ModPerl::ROOT::ModPerl::PerlRun::home_user_public_ +html_index_2ecgi::RC_NOT_ACCEPTABLE redefined at /usr/lib/perl5/ModPe +rl/Util.pm line 69. Constant subroutine ModPerl::ROOT::ModPerl::PerlRun::home_user_public_ +html_index_2ecgi::RC_PRECONDITION_REQUIRED redefined at /usr/lib/perl +5/ModPerl/Util.pm line 69.
The error log is filling up at light speed (several GB within a couple of hours). I have updated Perl, distro, apache, mod_perl and everything else. What could be causing this?

Replies are listed 'Best First'.
Re: Mod_perl errors filling up apache logs
by Anonymous Monk on Nov 20, 2012 at 22:23 UTC

      Well I have pinpointed the problem. It's a problem with LWP::UserAgent and LWP::Simple.

      Here is a some sample code. It acts as a post proxy. Every time this is ran I get 50 or so error messages as above.

      use LWP::UserAgent; my $ua = LWP::UserAgent->new; $ua->agent("send"); # Create a request my $req = HTTP::Request->new(POST => 'http://signup.website.com/in +dex.pl?action=signup'); $req->content_type('application/x-www-form-urlencoded'); use URI::Escape; my $username = uri_escape($CGI->param('username')); my $email = uri_escape($CGI->param('email')); my $password = uri_escape($CGI->param('password')); my $name = uri_escape($CGI->param('name')); my $recaptcha_response_field = uri_escape($CGI->param('recaptcha_r +esponse_field')); my $recaptcha_challenge_field = uri_escape($CGI->param('recaptcha_ +challenge_field')); my $affiliate_key = uri_escape($CGI->param('affiliate_key')); $req->content("username=$username&email=$email&password=$passwor +d&name=$name&recaptcha_response_field=$recaptcha_response_field&recap +tcha_challenge_field=$recaptcha_challenge_field&affiliate_key=$affili +ate_key&sitetype=clan"); # Pass request to the user agent and get a response back my $res = $ua->request($req); # Check the outcome of the response print $CGI->header(-type => "text/html"); if ($res->is_success) { print $res->content; }else { print $res->status_line, "\n"; }