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

Hi,

I've got a bit of a weird one here. I've got my site setup with mod_perl, but since I put that in I'm now seeing stuff like this in the error_log:

[Sat Nov 21 14:13:05 2015] Tools.pm: Prototype mismatch: sub Want::Too +ls::EXDEV: none vs () at /srv/www/site.net/www/cgi-bin/admin/Want/Too +ls.pm line 506. [Sat Nov 21 14:13:05 2015] Tools.pm: Prototype mismatch: sub Want::Too +ls::_SC_TZNAME_MAX: none vs () at /srv/www/site.net/www/cgi-bin/admin +/Want/Tools.pm line 506. [Sat Nov 21 14:13:05 2015] Tools.pm: Prototype mismatch: sub Want::Too +ls::EIDRM: none vs () at /srv/www/site.net/www/cgi-bin/admin/Want/Too +ls.pm line 506. [Sat Nov 21 14:13:05 2015] Tools.pm: Prototype mismatch: sub Want::Too +ls::VINTR: none vs () at /srv/www/site.net/www/cgi-bin/admin/Want/Too +ls.pm line 506. [Sat Nov 21 14:13:05 2015] Tools.pm: Prototype mismatch: sub Want::Too +ls::O_RDWR: none vs () at /srv/www/site.net/www/cgi-bin/admin/Want/To +ols.pm line 506. [Sat Nov 21 14:13:05 2015] Tools.pm: Prototype mismatch: sub Want::Too +ls::_PC_MAX_CANON: none vs () at /srv/www/site.net/www/cgi-bin/admin/ +Want/Tools.pm line 506. [Sat Nov 21 14:13:05 2015] Tools.pm: Prototype mismatch: sub Want::Too +ls::DBL_MIN_10_EXP: none vs () at /srv/www/site.net/www/cgi-bin/admin +/Want/Tools.pm line 506. [Sat Nov 21 14:13:05 2015] Tools.pm: Prototype mismatch: sub Want::Too +ls::VEOL: none vs () at /srv/www/site.net/www/cgi-bin/admin/Want/Tool +s.pm line 506. [Sat Nov 21 14:13:05 2015] Tools.pm: Prototype mismatch: sub Want::Too +ls::ENOSTR: none vs () at /srv/www/site.net/www/cgi-bin/admin/Want/To +ols.pm line 506. [Sat Nov 21 14:13:05 2015] Tools.pm: Prototype mismatch: sub Want::Too +ls::B19200: none vs () at /srv/www/site.net/www/cgi-bin/admin/Want/To +ols.pm line 506. [Sat Nov 21 14:13:05 2015] Tools.pm: Prototype mismatch: sub Want::Too +ls::ECANCELED: none vs () at /srv/www/site.net/www/cgi-bin/admin/Want +/Tools.pm line 506. [Sat Nov 21 14:13:05 2015] Tools.pm: Prototype mismatch: sub Want::Too +ls::S_IROTH: none vs () at /srv/www/site.net/www/cgi-bin/admin/Want/T +ools.pm line 506. [Sat Nov 21 14:13:05 2015] Tools.pm: Prototype mismatch: sub Want::Too +ls::IXON: none vs () at /srv/www/site.net/www/cgi-bin/admin/Want/Tool +s.pm line 506. [Sat Nov 21 14:13:05 2015] Tools.pm: Prototype mismatch: sub Want::Too +ls::CS7: none vs () at /srv/www/site.net/www/cgi-bin/admin/Want/Tools +.pm line 506. [Sat Nov 21 14:13:05 2015] Tools.pm: Prototype mismatch: sub Want::Too +ls::ECHOE: none vs () at /srv/www/site.net/www/cgi-bin/admin/Want/Too +ls.pm line 506. [Sat Nov 21 14:13:05 2015] Tools.pm: Prototype mismatch: sub Want::Too +ls::ECONNRESET: none vs () at /srv/www/site.net/www/cgi-bin/admin/Wan +t/Tools.pm line 506. [Sat Nov 21 14:13:05 2015] Tools.pm: Prototype mismatch: sub Want::Too +ls::CSIZE: none vs () at /srv/www/site.net/www/cgi-bin/admin/Want/Too +ls.pm line 506.
The weird thing, is that line 506 is just this: use POSIX; I'm also seeing this coming up a lot too:

[Sat Nov 21 16:27:43 2015] -e: Apache2::Reload: Can't locate (set by Moose)

...yet no line numbers, or any explanation as to where thats coming from.

Any suggestions on what I could check? My startup.pl script is pretty simple:

#!/usr/bin/perl use lib '/srv/www/site.net/www/cgi-bin/admin'; use Links::mod_perl; use Apache2::Connection (); use Apache2::RequestRec (); use APR::Table (); use POSIX; use CGI::Carp; use LWP::Simple; use GeoIP2::WebService::Client; # Automatically fix up the REMOTE_IP environment variable. sub My::ProxyRemoteAddr ($) { # ------------------------------------------------ my $r = shift; my $c = $r->connection(); my $ip = $c->remote_ip; unless ($ip eq '127.0.0.1') { return OK; } # Select last value in the chain -- ip from most recent proxy (to prev +ent fake ip injection) if (my ($ip) = $r->headers_in->{'HTTP_X_REAL_IP'} =~ /([^,\s]+)$/) + { $r->connection->remote_ip($ip); } return OK; } 1;
Its not causing a major issue (as far as I can see), but I can see it being a bit annoying when the traffic picks up, as the log files will get large VERY quick.

BTW: This is on Apache2 and Perl v5.20.2

Thanks!

Andy

Replies are listed 'Best First'.
Re: Weird mod_perl issue, popping up error on error_log
by Corion (Patriarch) on Nov 21, 2015 at 17:36 UTC

    First of all, while it may seem convenient, at least this error stems from your use of Apache::Reload:

    Apache2::Reload: Can't locate (set by Moose)

    This happens because Apache::Reload tries to reload a package which has been created not from a file but from within Moose. When reloading, Apache::Reload tries to find the file named (set by Moose), which predictably does not exist. This can be harmless but might also mean that the package is not recreated by Moose when you would expect it to. Stop and restarting Apache instead of trying to "smartly" reload it would help here.

    [Sat Nov 21 14:13:05 2015] Tools.pm: Prototype mismatch: sub Want::Too +ls::EXDEV: none vs () at /srv/www/site.net/www/cgi-bin/admin/Want/Too +ls.pm line 506.

    Maybe the above error also stems from reloading Want::Tools, which overwrites/redeclares the EXDEV subroutine with a slightly different prototype, or you have predeclared EXDEV via:

    sub EXDEV;

    ... but later declare it as sub EXDEV() { ... } or use constant EXDEV => ....

    Lastly, let me advise strongly against having any module below /srv/www/site.net/www/cgi-bin/ which is not a .pl script. Keep your configuration files and modules and other stuff out of cgi-bin, as a webserver misconfiguration could expose them (and include passwords or module versions or expose bugs in the modules that would be much harder to find otherwise).

      H,

      Thanks for the reply. Gotta admit, I'm confused =)

      Maybe the above error also stems from reloading Want::Tools, which overwrites/redeclares the EXDEV subroutine with a slightly different prototype, or you have predeclared EXDEV via: 
      Mmm, well I do include it in the startup.pl:

      use Want::View; use Want::Tools; use Want::Daily; use Want::Directory; ...etc
      ...and then its also included in some of the other custom perl modules (and some .cgi scripts). The problem is, my dev server isn't currently using mod_perl, so it would be hard to take those duplicate "use" statements out of the main code, and rely on them being loaded on the startup.pl boot.

      Maybe I will get the mod_perl stuff going on my dev server, and then see if I can get the errors to go away. Its a shame, as I was hoping not to use mod_perl on the dev server (as it causes a headache with caching of scripts, when you don't want to see a cached version ;))

      Lastly, let me advise strongly against having any module below /srv/www/site.net/www/cgi-bin/ which is not a .pl script. Keep your configuration files and modules and other stuff out of cgi-bin, as a webserver misconfiguration could expose them (and include passwords or module versions or expose bugs in the modules that would be much harder to find otherwise).
      Thanks for the advice. Its a bit tricky, as all those modules are part of a 3rd party system (and we've bolted out own code on). Also, they can't actually view the .pm files (only .cgi scripts will run in that folder, and all the rest would give 500 IS errors :))

      Cheers

      Andy
Re: Weird mod_perl issue, popping up error on error_log
by u65 (Chaplain) on Nov 21, 2015 at 17:17 UTC

    Just for completeness, can you please give your exact Apache and mod_perl versions?

      Hi,

      As requested:

      Server version: Apache/2.4.17 (Debian)

      mod_perl -> 2.000009

      Thanks :)

      Andy