Skip Menu |

This queue is for tickets about the Apache-AuthCookie CPAN distribution.

Report information
The Basics
Id: 64933
Status: resolved
Priority: 0/
Queue: Apache-AuthCookie

People
Owner: Nobody in particular
Requestors: B.Candler [...] pobox.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 3.15
Fixed in: (no value)



Subject: CPAN install as root fails at make test
(version actually 3.16. rt doesn't offer that one yet :-) Thank you for rapid fix to #64926. However, now a CPAN install fails differently when run as root: -------------------------- $ sudo cpan -i Apache2::AuthCookie CPAN: Storable loaded ok (v2.20) Going to read '/home/sysadm/.cpan/Metadata' Database was generated on Wed, 19 Jan 2011 19:36:18 GMT Running install for module 'Apache2::AuthCookie' CPAN: YAML loaded ok (v0.71) Running make for M/MS/MSCHOUT/Apache-AuthCookie-3.16.tar.gz CPAN: Digest::SHA loaded ok (v5.48) CPAN: Compress::Zlib loaded ok (v2.02) Checksum for /home/sysadm/.cpan/sources/authors/id/M/MS/MSCHOUT/Apache- AuthCookie-3.16.tar.gz ok CPAN: Archive::Tar loaded ok (v1.52) Apache-AuthCookie-3.16 Apache-AuthCookie-3.16/README Apache-AuthCookie-3.16/Changes Apache-AuthCookie-3.16/LICENSE Apache-AuthCookie-3.16/dist.ini Apache-AuthCookie-3.16/t Apache-AuthCookie-3.16/t/real.t Apache-AuthCookie-3.16/META.yml Apache-AuthCookie-3.16/MANIFEST Apache-AuthCookie-3.16/t/TEST.PL Apache-AuthCookie-3.16/SIGNATURE Apache-AuthCookie-3.16/weaver.ini Apache-AuthCookie-3.16/Makefile.PL Apache-AuthCookie-3.16/t/startup.pl Apache-AuthCookie-3.16/MANIFEST.SKIP Apache-AuthCookie-3.16/t/signature.t Apache-AuthCookie-3.16/README.modperl2 Apache-AuthCookie-3.16/t/conf Apache-AuthCookie-3.16/t/conf/extra.conf.in Apache-AuthCookie-3.16/t/htdocs/docs Apache-AuthCookie-3.16/t/htdocs/docs/login.pl Apache-AuthCookie-3.16/t/htdocs/docs/logout.pl Apache-AuthCookie-3.16/t/htdocs/docs/index.html Apache-AuthCookie-3.16/lib/Apache Apache-AuthCookie-3.16/lib/Apache/AuthCookie.pm Apache-AuthCookie-3.16/lib/Apache2 Apache-AuthCookie-3.16/lib/Apache2/AuthCookie.pm Apache-AuthCookie-3.16/t/htdocs/docs/echo_cookie.pl Apache-AuthCookie-3.16/lib/Apache/AuthCookie Apache-AuthCookie-3.16/lib/Apache/AuthCookie/Util.pm Apache-AuthCookie-3.16/lib/Apache/AuthCookie/FAQ.pod Apache-AuthCookie-3.16/t/Skeleton Apache-AuthCookie-3.16/t/Skeleton/AuthCookieHandler.pm Apache-AuthCookie-3.16/t/htdocs/docs/authany Apache-AuthCookie-3.16/t/htdocs/docs/authany/get_me.html Apache-AuthCookie-3.16/t/htdocs/docs/authall Apache-AuthCookie-3.16/t/htdocs/docs/authall/get_me.html Apache-AuthCookie-3.16/t/htdocs/docs/stimeout Apache-AuthCookie-3.16/t/htdocs/docs/stimeout/get_me.html Apache-AuthCookie-3.16/t/htdocs/docs/protected Apache-AuthCookie-3.16/t/htdocs/docs/protected/get_me.html Apache-AuthCookie-3.16/t/htdocs/docs/cookiename Apache-AuthCookie-3.16/t/htdocs/docs/cookiename/get_me.html Apache-AuthCookie-3.16/t/htdocs/docs/protected/echo_user.pl Apache-AuthCookie-3.16/t/lib/Sample Apache-AuthCookie-3.16/t/lib/Sample/AuthCookieHandler.pm.mp2 Apache-AuthCookie-3.16/t/lib/Sample/AuthCookieHandler.pm.mp1 CPAN: File::Temp loaded ok (v0.22) CPAN.pm: Going to build M/MS/MSCHOUT/Apache-AuthCookie-3.16.tar.gz selected t/lib/Sample/AuthCookieHandler.pm.mp2 [ info] generating script t/TEST Checking if your kit is complete... Looks good Writing Makefile for Apache::AuthCookie cp lib/Apache/AuthCookie/Util.pm blib/lib/Apache/AuthCookie/Util.pm cp lib/Apache2/AuthCookie.pm blib/lib/Apache2/AuthCookie.pm cp lib/Apache/AuthCookie.pm blib/lib/Apache/AuthCookie.pm cp lib/Apache/AuthCookie/FAQ.pod blib/lib/Apache/AuthCookie/FAQ.pod Manifying blib/man3/Apache::AuthCookie::Util.3pm Manifying blib/man3/Apache2::AuthCookie.3pm Manifying blib/man3/Apache::AuthCookie.3pm Manifying blib/man3/Apache::AuthCookie::FAQ.3pm MSCHOUT/Apache-AuthCookie-3.16.tar.gz /usr/bin/make -- OK Running make test /usr/bin/perl -Iblib/arch -Iblib/lib \ t/TEST -clean [warning] setting ulimit to allow core files ulimit -c unlimited; /usr/bin/perl /home/sysadm/.cpan/build/Apache- AuthCookie-3.16-bxAwjI/t/TEST -clean APACHE_TEST_GROUP= APACHE_TEST_HTTPD= APACHE_TEST_PORT= APACHE_TEST_USER= APACHE_TEST_APXS= \ /usr/bin/perl -Iblib/arch -Iblib/lib \ t/TEST -bugreport -verbose=0 [warning] setting ulimit to allow core files ulimit -c unlimited; /usr/bin/perl /home/sysadm/.cpan/build/Apache- AuthCookie-3.16-bxAwjI/t/TEST -bugreport -verbose=0 [ error] Apache cannot spawn child processes as root, therefore the test suite must be run as a non-privileged user. make: *** [run_tests] Error 1 MSCHOUT/Apache-AuthCookie-3.16.tar.gz /usr/bin/make test -- NOT OK //hint// to see the cpan-testers results for installing this module, try: reports MSCHOUT/Apache-AuthCookie-3.16.tar.gz Running make install make test had returned bad status, won't install without force -------------------------- This error is coming from /usr/local/lib/perl/5.10.1/Apache/TestRun.pm if ($user eq 'root') { error "Apache cannot spawn child processes as root, therefore the test suite must be run as a non-privileged user."; exit_perl(0); } This is different code to the one which comes with mod_perl2 in /usr/lib/perl5/Apache/TestRun.pm You are running the test suite under user 'root'. Apache cannot spawn child processes as 'root', therefore we attempt to run the test suite with user '$user' ($uid:$gid). That code also skips the test suite if it finds the filesystem permissions are unsuitable for running apache as that uid/gid. That seems to be a reasonable thing to do, but it looks like the newer Apache::TestRun is less forgiving. If I run cpan as a non-root user instead, the tests are OK, but copying the files to their final location fails: -------------------------- ... /usr/bin/make test -- OK Running make install Prepending /home/sysadm/.cpan/build/Apache-AuthCookie-3.16- 3_lFW0/blib/arch /home/sysadm/.cpan/build/Apache-AuthCookie-3.16- 3_lFW0/blib/lib to PERL5LIB for 'install' !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ERROR: Can't create '/usr/local/man/man3' Do not have write permissions on '/usr/local/man/man3' !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! at -e line 1 make: *** [pure_site_install] Error 13 MSCHOUT/Apache-AuthCookie-3.16.tar.gz /usr/bin/make install -- NOT OK ---- You may have to su to root to install the package (Or you may want to run something like o conf make_install_make_command 'sudo make' to raise your permissions. -------------------------- The o conf option gives a potential workaround, but you have to remember to run cpan as a non-root user.
This is an issue with your apache setup and Apache::Test, not AuthCookie. You would need to take this up with the maintainer of Apache::Test
From: B.Candler [...] pobox.com
Some additional info on versions. According to the log below, it looks like there is Apache::Test 1.31 in the base system; Apache::AuthCookie has a prerequisite of 1.32; and we actually get 1.34. ... CPAN.pm: Going to build M/MS/MSCHOUT/Apache-AuthCookie-3.16.tar.gz selected t/lib/Sample/AuthCookieHandler.pm.mp2 [ info] generating script t/TEST Checking if your kit is complete... Looks good Warning: prerequisite Apache::Test 1.32 not found. We have 1.31. Writing Makefile for Apache::AuthCookie Show quoted text
---- Unsatisfied dependencies detected during ---- ---- MSCHOUT/Apache-AuthCookie-3.16.tar.gz ---- Apache::Test [requires] Shall I follow them and prepend them to the queue of modules we are processing right now? [yes] Running make test Delayed until after prerequisites Running make install Delayed until after prerequisites Running install for module 'Apache::Test' Running make for P/PH/PHRED/Apache-Test-1.34.tar.gz Fetching with LWP: http://www.perl.org/CPAN/authors/id/P/PH/PHRED/Apache-Test-1.34.tar.gz ...
From: B.Candler [...] pobox.com
On Wed Jan 19 15:56:10 2011, MSCHOUT wrote: Show quoted text
> This is an issue with your apache setup and Apache::Test, not > AuthCookie. You would need to take this up with the maintainer of > Apache::Test
AuthCookie has a dependency on a specific version of Apache::Test. Is there a reason for that?
On Wed Jan 19 16:01:56 2011, B.Candler@pobox.com wrote: Show quoted text
> Some additional info on versions. According to the log below, it looks > like there is Apache::Test 1.31 in the base system; Apache::AuthCookie > has a prerequisite of 1.32; and we actually get 1.34.
This is all correct. The prerequisite means *AT LEAST* 1.32. 1.34 is the latest at this time. You need at least 1.32 because 1.31 will not configure properly where libapreq is not available (such as Ubuntu 10.10). I tested this. The fact that tests do not work as root is because of Apache::Test, not AuthCookie. Apache::Test has apparently made a decision to fail the test suite when you try to run it as root. I have no idea what if there is a suggested workaround for that (e.g.: environment variables, command line args to Makefile.PL) or not. You would need to ask the Apache::Test guys. You cannot downgrade to an earlier version of Apache::Test because that will fail for a different reason (no libapreq causes failure). There is nothing I can do about this. The problem is Apache::Test. Apache::Test change log has multiple references to running tests as root including: 1.34: - Don't attempt to run the test suite as root. The workarounds needed to facilitate root testing cause large maintenance costs, and return no tangible benefits. [Fred Moyer] 1.33: - https://rt.cpan.org/Public/Bug/Display.html?id=54476 Fix error where non root user gets test failure with httpd suexec and mod_fcgid [Peter (Stig) Edwards] Regards, Michael Schout
Although the problem is in Apache::Test, I've released 3.17 just now that works around this. If you are running as root, it skips the tests entirely. 3.17 should work for you.
Hi Michael, Brian Candler referred me to this RT ticket. Can you take a look at the way Apache2::Dispatch used Apache::Test to run the tests? Because of several test failures when running Apache::Test tests as root, Apache::Test was modified so that the Makefile test target skips the test if root is the current user. The core problem is using Apache::Test as a test dependency as oppose to using it as a Makefile.PL prerequisite. The preferred method is to create a Makefile dependent test target so that the tests are skipped if Apache::Test is not installed. Please let me know how I can be of help here. - Fred
CC: PHRED [...] cpan.org
Subject: Re: [rt.cpan.org #64933] CPAN install as root fails at make test
Date: Thu, 20 Jan 2011 10:17:39 -0600
To: bug-Apache-AuthCookie [...] rt.cpan.org
From: Michael Schout <mschout [...] gkg.net>
On 01/20/2011 09:47 AM, via RT wrote: Show quoted text
> Queue: Apache-AuthCookie > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=64933 > > > Hi Michael, > > Brian Candler referred me to this RT ticket. Can you take a look at the way Apache2::Dispatch > used Apache::Test to run the tests? Because of several test failures when running Apache::Test > tests as root, Apache::Test was modified so that the Makefile test target skips the test if root is > the current user.
Yes, it skips the tests, but exists with non-zero status, which as far as "make test" is concerned, is the same thing as if we tried to run them and failed. Unless I am missing something, this makes it impossible to install a modules that uses Apache::Tests via CPAN.pm when running as root without a some Makefile.PL gymnastics. I was going to look into fixing this in Apache::Test today, but in the meantime, I worked around it with this patch in my module: https://github.com/mschout/apache-authcookie/commit/19eebdb Show quoted text
> The core problem is using Apache::Test as a test dependency as oppose to using it as a > Makefile.PL prerequisite. The preferred method is to create a Makefile dependent test target so > that the tests are skipped if Apache::Test is not installed.
This is precisely what i have done. But it seems like an awful lot of Makefile.PL cruft (60 or so lines). Shouldn't Apache::Test add a Makefile target that exists with zero status if running as root? Regards, Michael Schout
Subject: Re: [rt.cpan.org #64933] CPAN install as root fails at make test
Date: Thu, 20 Jan 2011 08:24:23 -0800
To: bug-Apache-AuthCookie [...] rt.cpan.org
From: Fred Moyer <fred [...] redhotpenguin.com>
On Thu, Jan 20, 2011 at 8:17 AM, Michael Schout <mschout@gkg.net> wrote: Show quoted text
> On 01/20/2011 09:47 AM,  via RT wrote:
>>        Queue: Apache-AuthCookie >>  Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=64933 > >> >> Hi Michael, >> >> Brian Candler referred me to this RT ticket.  Can you take a look at the way Apache2::Dispatch >> used Apache::Test to run the tests?  Because of several test failures when running Apache::Test >> tests as root, Apache::Test was modified so that the Makefile test target skips the test if root is >> the current user.
> > Yes, it skips the tests, but exists with non-zero status, which as far > as "make test" is concerned, is the same thing as if we tried to run > them and failed.  Unless I am missing something, this makes it > impossible to install a modules that uses Apache::Tests via CPAN.pm when > running as root without a some Makefile.PL gymnastics.
Ah - thanks for the spot. In my tests, it returned a zero exit status, but I just tried with Apache::Dispatch as root and it is returning non-zero, even though the AT code specifies a zero exit status there. Let me hack on this today and see if I can get it resolved. Thanks for responding here; these changes were meant to avoid more Makefile.PL gymnastics :)