Can't 'use Apache::Request'

Bug #4727 reported by GrantMcLean
4
Affects Status Importance Assigned to Milestone
libapache-request-perl (Debian)
Fix Released
Unknown
libapache-request-perl (Ubuntu)
Fix Released
Medium
MOTU

Bug Description

When I attempt to use Apache::Request from my Apache config, I get the following error:

Can't load '/usr/lib/perl5/auto/Apache/Request/Request.so' for module Apache::Request: libapreq.so: cannot open shared object file: No such file or directory at /usr/lib/perl/5.8/DynaLoader.pm line 225.
 at /usr/lib/perl5/mod_perl.pm line 14
Compilation failed in require at /etc/apache-perl/conf.d/hoiho.conf line 13.
BEGIN failed--compilation aborted at /etc/apache-perl/conf.d/hoiho.conf line 13.

Here's an example which works under Debian Sarge. Save these lines in a file called /etc/apache-perl/conf.d/time.conf:

  <Perl>
    package ModPerl::Time;
    use Apache::Constants qw(:common);
    use Apache::Request ();

    sub handler {
        my $r = shift;
        my $apr = Apache::Request->new($r);

        print "Content-type: text/plain\n\n";
        print "The time is now: " . localtime . "\n";
        return OK;
    }
  </Perl>

  <Location /time>
      SetHandler perl-script
      PerlHandler ModPerl::Time
      PerlSendHeader On
  </Location>

If the lines referring to Apache request are removed, the code works via the url http://localhost/time

$ ls -l /usr/lib/perl5/auto/Apache/Request/Request.so /usr/lib/perl5/auto/libapreq/libapreq.so
-rw-r--r-- 1 root root 35452 2004-08-14 03:37 /usr/lib/perl5/auto/Apache/Request/Request.so
-rw-r--r-- 1 root root 17984 2004-08-14 03:37 /usr/lib/perl5/auto/libapreq/libapreq.so
$

Revision history for this message
In , Ron Lee (ron-debian) wrote : Re: Bug#322448: libapache-request-perl: Apache::Request fails with unresolved dynamic load

Hi,

You'll have to forgive my initial incredulity here, but this
patch appears to be some 2+ years old. Why exactly has no one
run into this and/or reported it before now?

thanks,
Ron

On Wed, Aug 10, 2005 at 10:34:26AM -0700, Jeffrey W. Baker wrote:
> Package: libapache-request-perl
> Version: 1.1-0.1
> Severity: grave
> Tags: patch
> Justification: renders package unusable
>
>
> The package is unusable because it is linked incorrectly. The error
> message is:
>
> Can't load '/usr/lib/perl5/auto/Apache/Request/Request.so' for module
> Apache::Request: libapreq.so: cannot open shared object file: No such
> file or directory at /usr/lib/perl/5.8/DynaLoader.pm line 225.\n at
> /usr/lib/perl5/mod_perl.pm line 14
>
> Here is a patch:
>
> Index: Cookie/Makefile.PL
> ===================================================================
> RCS file: /home/cvs/httpd-apreq/Cookie/Makefile.PL,v
> retrieving revision 1.5
> diff -u -r1.5 Makefile.PL
> --- Cookie/Makefile.PL 3 Apr 2001 19:24:08 -0000 1.5
> +++ Cookie/Makefile.PL 31 Jul 2003 11:31:06 -0000
> @@ -27,7 +27,7 @@
> @mm_args,
> 'INC' => "-I../c ". $src->inc,
> 'TYPEMAPS' => $src->typemaps,
> - 'LIBS' => "-L$root -lapreq",
> + 'OBJECT' => "Cookie.o $root/libapreq.a",
> 'dynamic_lib' => {
> 'OTHERLDFLAGS' => $src->otherldflags,
> },
> Index: Request/Makefile.PL
> ===================================================================
> RCS file: /home/cvs/httpd-apreq/Request/Makefile.PL,v
> retrieving revision 1.5
> diff -u -r1.5 Makefile.PL
> --- Request/Makefile.PL 3 Apr 2001 19:24:09 -0000 1.5
> +++ Request/Makefile.PL 31 Jul 2003 11:31:06 -0000
> @@ -27,7 +27,7 @@
> @mm_args,
> 'INC' => "-I../c ". $src->inc,
> 'TYPEMAPS' => $src->typemaps,
> - 'LIBS' => "-L$root -lapreq",
> + 'OBJECT' => "Request.o $root/libapreq.a",
> 'dynamic_lib' => {
> 'OTHERLDFLAGS' => $src->otherldflags,
> },
>
> -- System Information:
> Debian Release: 3.1
> APT prefers unstable
> APT policy: (500, 'unstable')
> Architecture: amd64 (x86_64)
> Shell: /bin/sh linked to /bin/bash
> Kernel: Linux 2.6.5-SLES9_SP1_BRANCH_2004111114454891_lustre.1.4.0smp
> Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
>
> Versions of packages libapache-request-perl depends on:
> ii libapache-mod-perl 1.29.0.3-7 integration of perl with the Apach
> ii perl 5.8.7-4 Larry Wall's Practical Extraction
> ii perl-base [perlapi-5.8.7] 5.8.7-4 The Pathologically Eclectic Rubbis
>
> libapache-request-perl recommends no packages.
>
> -- no debconf information
>
>

Revision history for this message
In , Ron Lee (ron-debian) wrote :

Ok. I'm going to presume the best course of action here is to
get 1.33 uploaded, which I would hope also fixes it. I think
Ivan Kohler is already looking into doing that at present...

cheers,
Ron

On Wed, Aug 10, 2005 at 12:07:03PM -0700, Jeffrey W. Baker wrote:
> On Thu, 2005-08-11 at 04:27 +0930, Ron wrote:
> > Hi,
> >
> > You'll have to forgive my initial incredulity here, but this
> > patch appears to be some 2+ years old. Why exactly has no one
> > run into this and/or reported it before now?
> >
> > thanks,
> > Ron
>
> I'm not really sure either, and I'm not seeing it on i686, so it may be
> some build system or linker difference on amd64, or it may be something
> that recently landed in unstable and broke it.
>
> Regards,
> jwb
>

Revision history for this message
In , Ron Lee (ron-debian) wrote : tagging 322448

# Automatically generated email from bts, devscripts version 2.9.4
tags 322448 + pending

Revision history for this message
In , Ron Lee (ron-debian) wrote : Re: libapache-request-perl maintenance

On Thu, Aug 11, 2005 at 01:31:06AM -0700, ivan wrote:
> On Thu, Aug 11, 2005 at 04:47:10AM +0930, Ron wrote:
> > are you actually working on a new upload for this now?
> > Please take a peek at #322448 in that case, if you aren't
> > aware of it already.
>
> hi, i am subscribed to the package in the BTS and also jeffrey found me
> on chat. if its still okay with you i plan to work on and upload 1.33
> soon and will include the patch in #322448.

Cool, thanks Ivan, I figured you would be onto it, I just wanted to be
sure that really was still the case. I doubt that you'll need/want the
patch for 1.33 though, take a peek at:

http://marc.theaimsgroup.com/?l=apreq-dev&m=105965131008577&w=2

noting especially the date reported. I'm not sure why amd64 has
broken out in this all of a sudden, but it seems fair to presume
it will have been fixed upstream several releases ago now.

I've tagged this (and #225111) pending then, so as not to distract
other bug watchers -- and I'll leave you holding the pumpkin to
prepare the new release as we discussed previously...

best,
Ron

Revision history for this message
In , Ivan Kohler (ivan-debian) wrote : Bug#322448: fixed in libapache-request-perl 1.33-1

Source: libapache-request-perl
Source-Version: 1.33-1

We believe that the bug you reported is fixed in the latest version of
libapache-request-perl, which is due to be installed in the Debian FTP archive:

libapache-request-perl_1.33-1.diff.gz
  to pool/main/liba/libapache-request-perl/libapache-request-perl_1.33-1.diff.gz
libapache-request-perl_1.33-1.dsc
  to pool/main/liba/libapache-request-perl/libapache-request-perl_1.33-1.dsc
libapache-request-perl_1.33-1_i386.deb
  to pool/main/liba/libapache-request-perl/libapache-request-perl_1.33-1_i386.deb
libapache-request-perl_1.33.orig.tar.gz
  to pool/main/liba/libapache-request-perl/libapache-request-perl_1.33.orig.tar.gz

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to <email address hidden>,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Ivan Kohler <ivan-debian@420.am> (supplier of updated libapache-request-perl package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing <email address hidden>)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.7
Date: Sat, 24 Sep 2005 03:01:02 -0700
Source: libapache-request-perl
Binary: libapache-request-perl
Architecture: source i386
Version: 1.33-1
Distribution: unstable
Urgency: low
Maintainer: Ron Lee <email address hidden>
Changed-By: Ivan Kohler <ivan-debian@420.am>
Description:
 libapache-request-perl - Generic Apache Request Library
Closes: 322448
Changes:
 libapache-request-perl (1.33-1) unstable; urgency=low
 .
   * New co-maintainer
   * New upstream release
     - fix linking problem (closes: Bug#322448)
       http://marc.theaimsgroup.com/?l=apreq-dev&m=105965131008577&w=2
   * Change Section: from interpreters to perl
   * Add watch file for uscan
   * Change to debhelper compat v4
Files:
 be0ac48a19da022afeecbdb7c70f4d9e 718 perl optional libapache-request-perl_1.33-1.dsc
 f5d2c36ae545aac6fd26cb03307df52b 328933 perl optional libapache-request-perl_1.33.orig.tar.gz
 a4bd2e9fb84759d42e15817beb045699 3466 perl optional libapache-request-perl_1.33-1.diff.gz
 6c1e100bba8b52aa45fc3916df0b0c4c 82194 perl optional libapache-request-perl_1.33-1_i386.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFDNcVogYcvm1TBwckRAuMHAJ9GOhCMETl8TUWQrAUyCwhWHYMT0gCeKCmh
/MgubGgOv4EIy3M23linlx0=
=u7lo
-----END PGP SIGNATURE-----

Revision history for this message
GrantMcLean (grant-mclean) wrote :

When I attempt to use Apache::Request from my Apache config, I get the following error:

Can't load '/usr/lib/perl5/auto/Apache/Request/Request.so' for module Apache::Request: libapreq.so: cannot open shared object file: No such file or directory at /usr/lib/perl/5.8/DynaLoader.pm line 225.
 at /usr/lib/perl5/mod_perl.pm line 14
Compilation failed in require at /etc/apache-perl/conf.d/hoiho.conf line 13.
BEGIN failed--compilation aborted at /etc/apache-perl/conf.d/hoiho.conf line 13.

Here's an example which works under Debian Sarge. Save these lines in a file called /etc/apache-perl/conf.d/time.conf:

  <Perl>
    package ModPerl::Time;
    use Apache::Constants qw(:common);
    use Apache::Request ();

    sub handler {
        my $r = shift;
        my $apr = Apache::Request->new($r);

        print "Content-type: text/plain\n\n";
        print "The time is now: " . localtime . "\n";
        return OK;
    }
  </Perl>

  <Location /time>
      SetHandler perl-script
      PerlHandler ModPerl::Time
      PerlSendHeader On
  </Location>

If the lines referring to Apache request are removed, the code works via the url http://localhost/time

$ ls -l /usr/lib/perl5/auto/Apache/Request/Request.so /usr/lib/perl5/auto/libapreq/libapreq.so
-rw-r--r-- 1 root root 35452 2004-08-14 03:37 /usr/lib/perl5/auto/Apache/Request/Request.so
-rw-r--r-- 1 root root 17984 2004-08-14 03:37 /usr/lib/perl5/auto/libapreq/libapreq.so
$

Changed in libapache-request-perl:
assignee: nobody → motu
Revision history for this message
GrantMcLean (grant-mclean) wrote :

I've noticed that when I install the tarball from CPAN, I end up with a file called /usr/local/lib/perl/5.8.7/auto/libapreq/libapreq.a rather than libapreq.so.

Similarly, on a Sarge system, the official package installs /usr/lib/perl5/auto/libapreq/libapreq.a.

Revision history for this message
Diona Kidd (diona) wrote :

I experienced this same issue as the first poster. The Apache error log complained:

[error] Can't load '/usr/lib/perl5/auto/Apache/Request/Request.so' for module Apache::Request: libapreq.so: cannot open shared object file: No such file or directory at /usr/lib/perl/5.8/DynaLoader.pm line 225.\n at /usr/lib/perl5/mod_perl.pm line 14\nCompilation failed in require at /usr/local/share/perl/5.8.7/HTML/Mason/ApacheHandler.pm line 698.\n

[error] Can't locate object method "new" via package "Apache::Request" at /usr/lib/perl5/Apache/Request.pm line 22.\n

I did a 'find / -name libapreq.so*' on the system and found libapreq.so in /usr/lib/perl5/auto/libapreq/libapreq.so. I then symbolically linked libapreq.so in /usr/lib/

cd /usr/lib/;
ln -s /usr/lib/perl5/auto/libapreq/libapreq.so

The error is no longer displaying in the Apache error log.

Changed in libapache-request-perl:
status: Unconfirmed → Confirmed
Revision history for this message
Daniel Robitaille (robitaille) wrote :

According to the Debian bug report, this was solved in Debian in Sept 2005 with version 1.33-1.

That version is the one currently available in Ubuntu Dapper. I'll mark this report as fixed. If you are still experiencing this problem in Dapper, please feel free to re-open it.

Changed in libapache-request-perl:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.