http://qs321.pair.com?node_id=516175

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

Here's an odd one: Every time I install something with CPAN, I have to wait about four minutes for it to time out getting "01mailrc.txt.gz". Everything else about CPAN is fine:
# cpan cpan shell -- CPAN exploration and modules installation (v1.76) ReadLine support enabled cpan> install Date::Format CPAN: Storable loaded ok Going to read /Users/brian/.cpan/Metadata Database was generated on Thu, 08 Dec 2005 23:00:12 GMT CPAN: LWP::UserAgent loaded ok Fetching with LWP: ftp://ftp.perl.org/pub/CPAN/authors/01mailrc.txt.gz LWP failed with code[400] message[FTP return code 000] Fetching with Net::FTP: ftp://ftp.perl.org/pub/CPAN/authors/01mailrc.txt.gz Couldn't fetch 01mailrc.txt.gz from ftp.perl.org Issuing "/usr/bin/ftp -n" ...
I've tried deleting ~/root/.cpan, but the problem comes back. Directly ftp'ing is fine, no hang, no timeout, no pause, no delay, no trouble getting "01mailrc.txt.gz":
# ftp ftp.perl.org Trying 199.239.233.95... Connected to ftp.cpan.ddns.develooper.com. ...

Replies are listed 'Best First'.
Re: CPAN times out on "01mailrc.txt.gz", every time, Mac OS X Darwin (passive)
by tye (Sage) on Dec 13, 2005 at 02:25 UTC

    Pick an HTTP mirror or turn on 'passive' FTP (by setting the FTP_PASSIVE environment variables to 1, for example).

    Yes, I agree that it is quite unfortunately that CPAN.pm comes "out of the box" in a configuration that makes it time out mysterious for several minutes and then do nothing useful (if run on a machine that is behind a firewall, which should be all machines but is surely a very large fraction of machines).

    - tye        

      Thanks, that was the pointer I needed to find http://sial.org/howto/perl/life-with-cpan/, and this worked:
      env FTP_PASSIVE=1 cpan -i Net::FTP
      I never would have guessed this myself, since the actual module installation was fine, only the mailrc failed to load (and cpan never really seemed to care). How do I set the mirror? I don't find a Config.pm in my ~/.cpan.
        This worked for me as well. I was getting the same on the 01mailrc.txt.gz hanging everytime i tried to install modules. I couldn't figure out why. Again, thanks. BTW i my OS is FreeBSD 5.4

        "Es gibt mehr zu Leben als Bücher, kennen Sie. Aber nicht viel mehr " -(Der Smiths)
        The file you're looking for is called ~/.cpan/CPAN/MyConfig.pm
        --
        @/=map{[/./g]}qw/.h_nJ Xapou cets krht ele_ r_ra/; map{y/X_/\n /;print}map{pop@$_}@/for@/
Re: CPAN times out on "01mailrc.txt.gz", every time, Mac OS X Darwin
by thor (Priest) on Dec 12, 2005 at 23:52 UTC
    I used to hate waiting for the file to download, too. Then, I included minicpan in a weekly cron job and pointed cpan (actually cpanp) to use that as its repository. I couldn't recommend this more. It's a pretty elegant solution, IMO.

    thor

    The only easy day was yesterday

Re: CPAN times out on "01mailrc.txt.gz", every time, Mac OS X Darwin
by stvn (Monsignor) on Dec 13, 2005 at 01:28 UTC

    I had similar issues at one point, and I turned off the Mac OS X built-in firewall and they went away. However, I don't think that is a long term solution, but it might be a start in figuring out what is going wrong.

    -stvn