You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Jason Dixon <ja...@dixongroup.net> on 2004/11/02 16:30:32 UTC

Apache profiler errors

Note:  Folks on perlmonks might recognize this post from last night.  
There have been no responses, so I'm posting it to the mod_perl list.

I'm trying to profile some perl CGI someone else wrote, but I can't 
seem to get Apache::DProf working.  My server runs Apache 2.0.46 with 
mod_perl 1.99 and Apache::DProf 0.09.  I'm getting the following error 
when trying to start Apache when Apache::DProf is set to load in 
httpd.conf:

<code>
Starting httpd: [Mon Nov 01 22:37:13 2004] [error] Can't locate object 
method "server_root_relative" via package "Apache::Server" at 
/usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Apache/DProf.pm 
line 30.!Compilation failed in require at (eval 2) line 3.!
[Mon Nov 01 22:37:13 2004] [error] Can't load Perl module Apache::DProf 
for server localhost:0, exiting...!
</code>

Now, if I'm not mistaken, server_root_relative is in 
Apache::ServerUtil.  Looking at the relevant portion of DProf.pm, it 
appears to handle the differences between Apache1 and Apache2 
correctly, so Apache::compat shouldn't be necessary (although I've 
tried that too):

<code>
package Apache::DProf;

use strict;
use Apache::DB ();
use File::Path ();

{
     no strict;
     $VERSION = '0.04';
}

# Need to determine if we are in a mod_perl 1.x or 2.x environment
# and load the appropriate modules
BEGIN {
         use constant MP2 => eval { require mod_perl; $mod_perl::VERSION 
 > 1.99 };
         die "mod_perl is required to run this module: $@" if $@;

         if (MP2) {
                 require Apache2;
                 require Apache::RequestRec;
                 require Apache::ServerUtil;
         }
}


# Adjust to handle mp1 and mp2 differently
my $prof_path;
if (MP2) {
     my $s = Apache->server;
     $prof_path = $s->server_root_relative( $ENV{APACHE_DPROF_PATH} ||
                                            "logs/dprof");
}
else {
     $prof_path = Apache->server_root_relative($ENV{APACHE_DPROF_PATH} ||
                                            "logs/dprof");
}
</code>

Any ideas why this module is failing for me?  I've tried Googling on 
the server_root_relative error, but this inevitably directs me to 
Apache::compat suggestions, which I don't think are relevant to this 
module.

Thanks,

--
Jason Dixon
DixonGroup Consulting
http://www.dixongroup.net


-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: Apache profiler errors

Posted by Perrin Harkins <pe...@elem.com>.
On Tue, 2004-11-02 at 10:45, Jason Dixon wrote:
> Unfortunately not.  The client has mandated that we stick with the RHEL 
> package for "supportability".

That's precisely the reason you shouldn't stick with the RHEL package. 
The version of mod_perl they ship is ancient and hard for the mod_perl
devs to support since so many of its bugs have been fixed in later
releases.  Please at least try it on a test machine and see if it fixes
the problem.

- Perrin


-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: Apache profiler errors

Posted by Jason Dixon <ja...@dixongroup.net>.
On Nov 2, 2004, at 10:35 AM, Perrin Harkins wrote:

> On Tue, 2004-11-02 at 10:30, Jason Dixon wrote:
>> My server runs Apache 2.0.46 with
>> mod_perl 1.99 and Apache::DProf 0.09.
>
> Can you re-try with the latest?  The current apache release is 2.0.52
> and the current mod_perl release is 1.99_17.

Unfortunately not.  The client has mandated that we stick with the RHEL 
package for "supportability".

Thanks,

--
Jason Dixon
DixonGroup Consulting
http://www.dixongroup.net



-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: Apache profiler errors

Posted by Perrin Harkins <pe...@elem.com>.
On Tue, 2004-11-02 at 10:30, Jason Dixon wrote:
> My server runs Apache 2.0.46 with 
> mod_perl 1.99 and Apache::DProf 0.09.

Can you re-try with the latest?  The current apache release is 2.0.52
and the current mod_perl release is 1.99_17.

- Perrin


-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: Apache profiler errors

Posted by Randy Kobes <ra...@theoryx5.uwinnipeg.ca>.
On Tue, 2 Nov 2004, Frank Wiles wrote:

> On Tue, 2 Nov 2004 10:44:41 -0500
> Jason Dixon <ja...@dixongroup.net> wrote:
>
> > On Nov 2, 2004, at 10:37 AM, Frank Wiles wrote:
> >
> > >   I believe this is caused by a documentation bug I've yet to fix in
> > >   Apache::DProf.  Try preloading Apache2 in your startup.pl and it
> > >   should work for you.
> >
> > Hi Frank-
> >
> > I'm still getting the error:
> >
> > Starting httpd: [Tue Nov 02 10:42:26 2004] [error] Can't locate object
> >
> > method "server_root_relative" via package "Apache::Server" at
> > /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Apache/DProf.pm

Instead of server_root_relative, does using
  File::Spec->catfile(Apache::ServerUtil::server_root, $fname)
work?

-- 
best regards,
randy kobes

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: Apache profiler errors

Posted by Frank Wiles <fr...@wiles.org>.
On Tue, 02 Nov 2004 18:51:20 +0100
Tom Schindl <to...@gmx.at> wrote:

> Of course he is have you read the since tag in the docs? :-)

  hehehe actually I hadn't, boy do I feel silly now... 

 ---------------------------------
   Frank Wiles <fr...@wiles.org>
   http://www.wiles.org
 ---------------------------------


-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: Apache profiler errors

Posted by Tom Schindl <to...@gmx.at>.
Frank Wiles wrote:
> On Tue, 2 Nov 2004 11:24:40 -0500
> Jason Dixon <ja...@dixongroup.net> wrote:
> 
> 
>>On Nov 2, 2004, at 11:15 AM, Frank Wiles wrote:
>>
>>
>>>  I'm thinking Apache::compat might be confusing it.  Can you try
>>>  running without it?
>>
>>Commented out Apache::compat, same error.  :(
> 
> 
>   Unfortunately, I think Perrin is right.  You'll have to upgrade to
>   the latest Apache/mp2 combo to get this working.  While I also 
>   try to keep in pace with RHEL, Apache2/mp2 is just a place where
>   you really can't.  Too much has changed since 1.99_12 (which IIRC
>   is what RHEL ships with). 
> 

Of course he is have you read the since tag in the docs? :-)

---------------8<---------------
...
since: 1.99_15
...
---------------8<---------------

>   You can however, rebuild with RHEL RPMs with the newer sources
>   without very much trouble.  
> 
>  ---------------------------------
>    Frank Wiles <fr...@wiles.org>
>    http://www.wiles.org
>  ---------------------------------
> 
> 


-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: Apache profiler errors

Posted by Frank Wiles <fr...@wiles.org>.
On Tue, 2 Nov 2004 11:24:40 -0500
Jason Dixon <ja...@dixongroup.net> wrote:

> On Nov 2, 2004, at 11:15 AM, Frank Wiles wrote:
> 
> >   I'm thinking Apache::compat might be confusing it.  Can you try
> >   running without it?
> 
> Commented out Apache::compat, same error.  :(

  Unfortunately, I think Perrin is right.  You'll have to upgrade to
  the latest Apache/mp2 combo to get this working.  While I also 
  try to keep in pace with RHEL, Apache2/mp2 is just a place where
  you really can't.  Too much has changed since 1.99_12 (which IIRC
  is what RHEL ships with). 

  You can however, rebuild with RHEL RPMs with the newer sources
  without very much trouble.  

 ---------------------------------
   Frank Wiles <fr...@wiles.org>
   http://www.wiles.org
 ---------------------------------


-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: Apache profiler errors

Posted by Jason Dixon <ja...@dixongroup.net>.
On Nov 2, 2004, at 11:15 AM, Frank Wiles wrote:

>   I'm thinking Apache::compat might be confusing it.  Can you try
>   running without it?

Commented out Apache::compat, same error.  :(

Thanks,

--
Jason Dixon
DixonGroup Consulting
http://www.dixongroup.net



-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: Apache profiler errors

Posted by Frank Wiles <fr...@wiles.org>.
On Tue, 2 Nov 2004 11:03:11 -0500
Jason Dixon <ja...@dixongroup.net> wrote:

> On Nov 2, 2004, at 10:59 AM, Frank Wiles wrote:
> 
> >   Hmmmm... ok try adding Apache::ServerUtil in your startup.pl, I
> >   may have written down Apache2 as the fix, but it might really be
> >   Apache::ServerUtil.
> 
> Unfortunately, that didn't work either.  Here's my startup.pl:
> 
> [root@colo root]# cat /var/www/perl/startup.pl
> use lib qw(/var/www/perl);
> use Apache2;
> use Apache::ServerUtil;
> use Apache::RequestRec;
> use Apache::compat;
> 1;

  I'm thinking Apache::compat might be confusing it.  Can you try
  running without it? 

 ---------------------------------
   Frank Wiles <fr...@wiles.org>
   http://www.wiles.org
 ---------------------------------


-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: Apache profiler errors

Posted by Jason Dixon <ja...@dixongroup.net>.
On Nov 2, 2004, at 10:59 AM, Frank Wiles wrote:

>   Hmmmm... ok try adding Apache::ServerUtil in your startup.pl, I
>   may have written down Apache2 as the fix, but it might really be
>   Apache::ServerUtil.

Unfortunately, that didn't work either.  Here's my startup.pl:

[root@colo root]# cat /var/www/perl/startup.pl
use lib qw(/var/www/perl);
use Apache2;
use Apache::ServerUtil;
use Apache::RequestRec;
use Apache::compat;
1;

Thanks again,

--
Jason Dixon
DixonGroup Consulting
http://www.dixongroup.net



-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: Apache profiler errors

Posted by Frank Wiles <fr...@wiles.org>.
On Tue, 2 Nov 2004 10:44:41 -0500
Jason Dixon <ja...@dixongroup.net> wrote:

> On Nov 2, 2004, at 10:37 AM, Frank Wiles wrote:
> 
> >   I believe this is caused by a documentation bug I've yet to fix in
> >   Apache::DProf.  Try preloading Apache2 in your startup.pl and it
> >   should work for you.
> 
> Hi Frank-
> 
> I'm still getting the error:
> 
> Starting httpd: [Tue Nov 02 10:42:26 2004] [error] Can't locate object
> 
> method "server_root_relative" via package "Apache::Server" at 
> /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Apache/DProf.pm
> 
> line 30.!Compilation failed in require at (eval 2) line 3.!
> [Tue Nov 02 10:42:26 2004] [error] Can't load Perl module
> Apache::DProf for server localhost:0, exiting...!
> 
> If there's anything else you'd like to see (httpd.conf, perl.conf, 
> startup.pl), please let me know.

  Hmmmm... ok try adding Apache::ServerUtil in your startup.pl, I
  may have written down Apache2 as the fix, but it might really be
  Apache::ServerUtil.  

 ---------------------------------
   Frank Wiles <fr...@wiles.org>
   http://www.wiles.org
 ---------------------------------


-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: Apache profiler errors

Posted by Jason Dixon <ja...@dixongroup.net>.
On Nov 2, 2004, at 10:37 AM, Frank Wiles wrote:

>   I believe this is caused by a documentation bug I've yet to fix in
>   Apache::DProf.  Try preloading Apache2 in your startup.pl and it
>   should work for you.

Hi Frank-

I'm still getting the error:

Starting httpd: [Tue Nov 02 10:42:26 2004] [error] Can't locate object 
method "server_root_relative" via package "Apache::Server" at 
/usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Apache/DProf.pm 
line 30.!Compilation failed in require at (eval 2) line 3.!
[Tue Nov 02 10:42:26 2004] [error] Can't load Perl module Apache::DProf 
for server localhost:0, exiting...!

If there's anything else you'd like to see (httpd.conf, perl.conf, 
startup.pl), please let me know.

Thanks,

--
Jason Dixon
DixonGroup Consulting
http://www.dixongroup.net



-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: Apache profiler errors

Posted by Frank Wiles <fr...@wiles.org>.
On Tue, 2 Nov 2004 10:30:32 -0500
Jason Dixon <ja...@dixongroup.net> wrote:

> Note:  Folks on perlmonks might recognize this post from last night.  
> There have been no responses, so I'm posting it to the mod_perl list.
> 
> I'm trying to profile some perl CGI someone else wrote, but I can't 
> seem to get Apache::DProf working.  My server runs Apache 2.0.46 with 
> mod_perl 1.99 and Apache::DProf 0.09.  I'm getting the following error
> 
> when trying to start Apache when Apache::DProf is set to load in 
> httpd.conf:
> 
> <code>
> Starting httpd: [Mon Nov 01 22:37:13 2004] [error] Can't locate object
> 
> method "server_root_relative" via package "Apache::Server" at 
> /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Apache/DProf.pm
> 
> line 30.!Compilation failed in require at (eval 2) line 3.!
> [Mon Nov 01 22:37:13 2004] [error] Can't load Perl module
> Apache::DProf for server localhost:0, exiting...!
> </code>
> 
> Now, if I'm not mistaken, server_root_relative is in 
> Apache::ServerUtil.  Looking at the relevant portion of DProf.pm, it 
> appears to handle the differences between Apache1 and Apache2 
> correctly, so Apache::compat shouldn't be necessary (although I've 
> tried that too):

  I believe this is caused by a documentation bug I've yet to fix in
  Apache::DProf.  Try preloading Apache2 in your startup.pl and it
  should work for you. 

  If not feel free to contact me again and I'll help you get it sorted
  out. 

 ---------------------------------
   Frank Wiles <fr...@wiles.org>
   http://www.wiles.org
 ---------------------------------


-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html