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

cpan has started failing for me on the command line on my production machine. When I run "cpan X" it downloads the X tar file, generates an empty Makefile.PL and then complains that everything is missing.

However I have deeper problems. When I tried to install DBD::SQLite it ran out of memory during compilation. Not so much of a problem as that module is not required for production purposes but it does mean I cannot run any test script depending on DBD::SQLite.

But it gets worse. My production machine is a ubuntu hardy running perl 5.8. My test machine is a debian running perl 5.10. For a long time I tried to hold back the perl version on the test machine to keep it in sync with production. However in the end that just got to be more and more of a handicap as things refused to install. Upgrading the production machine is out of the question (just checked with the service provider). Changing the test machine to ubuntu on the current hardware in a big bang is also out of the question. I know I am going to have to get another test machine and move across gradually. But does anybody have any suggestions in the meantime?

Edit: I have just tried manually upgrading CPAN. The test scripts run fine but the wider issues remain.

  • Comment on perl module installs getting really mesed up

Replies are listed 'Best First'.
Re: perl module installs getting really mesed up
by Corion (Patriarch) on Sep 10, 2009 at 10:34 UTC

    Please show us the output of such a botched cpan session. I think I remember that problem, and it had something to do with installing a bad version of Archive::Tar which didn't extract the distributions properly. - have you changed anything in your setup there?

    The other problems I can help only little with - either find a separate machine with the same architecture, on which you can compile the modules and then copy them over, or maybe use CPAN::SQLite, which supposedly has lesser memory requirements.

    For your test machine, just compile your own "dev" Perl, a Perl 5.8.8 - that should be all that's needed and that's just a download of perl and

    tar xvf ... sh Configure -Dprefix=/home/silas/perl-5.8.8
      Please show us the output of such a botched cpan session.
      cpan UNIVERSAL::can CPAN: Storable loaded ok (v2.15) Going to read /root/.cpan/Metadata Database was generated on Thu, 10 Sep 2009 00:27:04 GMT CPAN: YAML loaded ok (v0.68) Going to read 45 yaml files from /root/.cpan/build/ CPAN: Time::HiRes loaded ok (v1.86) ...................................................................... +......DONE Restored the state of 45 (in 0.4750 secs) Running install for module 'UNIVERSAL::can' Running make for C/CH/CHROMATIC/UNIVERSAL-can-1.15.tar.gz Unwrapping had some problem, won't try again without force Had problems unarchiving. Please build manually Running make test Make had some problems, won't test Running make install Make had some problems, won't install
      A manual install works without any issues.
      I think I remember that problem, and it had something to do with installing a bad version of Archive::Tar which didn't extract the distributions properly.
      I have tried Archive::Tar upgrading from 1.48 to 1.52 but it has made no difference. An example of where everything is missing.
      prod> ls -l total 2513 drwxr-xr-x 8 1000 1000 1024 Sep 10 11:03 CPAN-1.9402 -rw-r--r-- 1 root root 2560000 Sep 10 09:36 CPAN-1.9402.tar -rw-r--r-- 1 root root 242 Sep 10 09:36 Makefile.PL prod> cat Makefile.PL # This Makefile.PL has been autogenerated by the module CPAN.pm # because there was no Makefile.PL supplied. # Autogenerated on: Thu Sep 10 09:36:55 2009 use ExtUtils::MakeMaker; WriteMakefile( NAME => q[CPAN], );
      Again a manual install worked.
      r maybe use CPAN::SQLite, which supposedly has lesser memory requirements. For your test machine, just compile your own "dev" Perl, a Perl 5.8.8 -
      Both ideas sound worth a try and will get added to the evergrowing to do list.
Re: perl module installs getting really mesed up
by almut (Canon) on Sep 10, 2009 at 10:11 UTC
    ...and then complains that everything is missing.

    What exactly is "everything"? I would start by picking out a couple of the those modules that are supposedly missing, and check manually (outside of the cpan shell) whether they're installed and can be loaded.

    Update: regarding your edit, what wider issues do you still need help with?

Re: perl module installs getting really mesed up
by Anonymous Monk on Sep 10, 2009 at 10:12 UTC
    When I run "cpan X" it downloads the X tar file, generates an empty Makefile.PL and then complains that everything is missing.

    What did you expect to happen? Are you sure you weren't thinking of cpanp x (aka cpanp -x)? Which version of cpan?

    However I have deeper problems. When I tried to install DBD::SQLite it ran out of memory during compilation.

    Were you trying to install with cpan? Try from the shell CPAN>look DBD::SQLite or cpanp z ADAMK/DBD-SQLite-1.26_03.tar.gz

      cpan[2]> install CPAN::SQLite Running install for module 'CPAN::SQLite' Running make for R/RK/RKOBES/CPAN-SQLite-0.197.tar.gz Unwrapping had some problem, won't try again without force Had problems unarchiving. Please build manually Running make test Make had some problems, won't test Running make install Make had some problems, won't install cpan[3]> look DBD::SQLite Running look for module 'DBD::SQLite' Trying to open a subshell in the build directory... Working directory is /root/.cpan/build/DBD-SQLite-1.25-9OFGQP
      I also have no "cpanp" in my path.
        Why did you stop there?
Re: perl module installs getting really mesed up
by leocharre (Priest) on Sep 10, 2009 at 14:53 UTC
    I want to know more about the part where you say ...cpan has started failing for me on the co...
    When did it start? Was it working before, do you remember?

    (I'm looking through the posts and I don't see anything about when it did work- If I missed it please excuse me.)

    • If it was working before, what changed?
    • Are there other users with your level of access to that machine?
    • What about ENV (environment variables)? Use # set on the cli
    • check your ~/.bashrc , is there anything new in there for paths, libs etc?
    • Check for symlinks in /usr/lib/perl* between directories
      If it was working before, what changed?
      I cannot say that every install was always smooth. But usually it would fail somewhere in the test. I don't remember having these difficulties. It used to be the case that I could install a module, it would pull in a few dependencies and only occasionally fail. I cannot think of anything that has changed that would explain it.
      Are there other users with your level of access to that machine?
      No. Obviously there is the service provider but I don't think perl support is in the service agreement. It's all down to me.
      What about ENV (environment variables)? check your ~/.bashrc , is there anything new in there for paths, libs etc? Check for symlinks in /usr/lib/perl* between directories
      minimal

      Edit: I forgot to mention I don't get these issues on the test machine.

        • It may also be worth looking over your cpan config...

          It may be somewhere like '/usr/lib/perl5/5.8.8/CPAN/Config.pm' .. I think maybe older CPAN was using the ~/.cpan dir or something with config- not certain about that. The default config can be overridden with ~/.cpan/CPAN/MyConfig.pm (see below)

          Try # locate CPAN | grep -i config

          Here is one of mine (/usr/lib/perl5/5.8.8/CPAN/Config.pm), in case something really different stands out..

          # This is CPAN.pm's systemwide configuration file. This file provides # defaults for users, and the values can be changed in a per-user # configuration file. The user-config file is being looked for as # ~/.cpan/CPAN/MyConfig.pm. $CPAN::Config = { 'auto_commit' => q[1], 'build_cache' => q[10], 'build_dir' => q[/root/.cpan/build], 'cache_metadata' => q[1], 'commandnumber_in_prompt' => q[1], 'cpan_home' => q[/root/.cpan], 'dontload_hash' => { }, 'ftp' => q[/usr/bin/ftp], 'ftp_passive' => q[1], 'ftp_proxy' => q[], 'getcwd' => q[cwd], 'gpg' => q[/usr/bin/gpg], 'gzip' => q[/usr/bin/gzip], 'histfile' => q[/root/.cpan/histfile], 'histsize' => q[500], 'http_proxy' => q[], 'inactivity_timeout' => q[0], 'index_expire' => q[1], 'inhibit_startup_message' => q[0], 'keep_source_where' => q[/root/.cpan/sources], 'make' => q[/usr/bin/make], 'make_arg' => q[], 'make_install_arg' => q[], 'make_install_make_command' => q[/usr/bin/make], 'makepl_arg' => q[], 'mbuild_arg' => q[], 'mbuild_install_arg' => q[], 'mbuild_install_build_command' => q[./Build], 'mbuildpl_arg' => q[], 'ncftp' => q[/usr/bin/ncftpget], 'ncftpget' => q[], 'no_proxy' => q[], 'pager' => q[/usr/bin/less], 'prerequisites_policy' => q[follow], 'scan_cache' => q[atstart], 'shell' => q[/bin/bash], 'show_upload_date' => q[0], 'tar' => q[/bin/tar], 'term_is_latin' => q[1], 'term_ornaments' => q[1], 'unzip' => q[/usr/bin/unzip], 'urllist' => [q[ftp://cpan.pair.com/pub/CPAN/], q[ftp://carroll.cac. +psu.edu/pub/CPAN/]], 'use_sqlite' => q[0], 'wget' => q[/usr/bin/wget], }; 1; __END__

          Also, I am assuming you are running as root.. look inside ~/.cpan/CPAN/MyConfig.pm, is that file there? Anything strange?

        • And you did mention you looked inside ~/.bashrc and there's nothing freaky.

        • Maybe also compare the test and production machines cpan configs (against each other).. and their env set variables ( with '# set' ).

        • And maybe '# uname -a' on both machines, maybe check google for anything with cpan fails and that architecture.. google for = 'site:http://www.linuxquestions.org/ $architecture cpan failure' (there may be something)

        (You probably already did all of this, I don't want to seem patronizing)