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

Lately I've been having sub-optimal results using the cpan shell on my laptop. The problem is all up front: the inability of cpan to quickly access files on the mirror. The following now typically takes a full 3 to 5 minutes:

$ cpan CPAN: File::HomeDir loaded ok (v0.58) CPAN: Term::ANSIColor loaded ok (v1.12) Sorry, we have to rerun the configuration dialog for CPAN.pm due to some missing parameters... Normally CPAN.pm keeps config variables in memory and changes need to be saved in a separate 'o conf commit' command to make them permanent between sessions. If you set the 'auto_commit' option to true, changes to a config variable are always automatically committed to disk. <auto_commit> Always commit changes to config variables to disk? [no] Please remember to call 'o conf commit' to make the config permanent! cpan shell -- CPAN exploration and modules installation (v1.9205) ReadLine support enabled + cpan[1]> install Perl::Critic CPAN: Storable loaded ok (v2.18) Going to read /Users/jimk/.cpan/Metadata Database was generated on Sun, 06 Apr 2008 05:30:09 GMT CPAN: LWP::UserAgent loaded ok (v2.033) CPAN: Time::HiRes loaded ok (v1.9711) Fetching with LWP: ftp://cpan.cse.msu.edu/authors/01mailrc.txt.gz LWP failed with code[404] message[Can't chdir to authors] Fetching with Net::FTP: ftp://cpan.cse.msu.edu/authors/01mailrc.txt.gz Couldn't cwd authors: authors: No such file or directory Fetching with Net::FTP ftp://cpan.cse.msu.edu/authors/01mailrc.txt.gz.gz Couldn't cwd authors: authors: No such file or directory Trying with "/usr/bin/curl -L -f -s -S --netrc-optional" to get ftp://cpan.cse.msu.edu/authors/01mailrc.txt.gz curl: (9) Server denied you to change to the given directory System call "/usr/bin/curl -L -f -s -S --netrc-optional "ftp://cpa +n.cse.msu.edu/authors/01mailrc.txt.gz" > /Users/jimk/.cpan/sources/a +uthors/01mailrc.txt.tmp25321" returned status 9 (wstat 2304) Warning: expected file [/Users/jimk/.cpan/sources/authors/01mailrc.txt +.gz.tmp25321] doesn't exist Trying with "/usr/local/bin/wget -O /Users/jimk/.cpan/sources/authors/ +01mailrc.txt.tmp25321" to get ftp://cpan.cse.msu.edu/authors/01mailrc.txt.gz --18:46:11-- ftp://cpan.cse.msu.edu/authors/01mailrc.txt.gz => `/Users/jimk/.cpan/sources/authors/01mailrc.txt.tmp25321 +' Resolving cpan.cse.msu.edu... 35.9.25.25 Connecting to cpan.cse.msu.edu[35.9.25.25]:21... connected. Logging in as anonymous ... Logged in! ==> SYST ... done. ==> PWD ... done. ==> TYPE I ... done. ==> CWD /authors ... No such directory `authors'. System call "/usr/local/bin/wget -O /Users/jimk/.cpan/sources/auth +ors/01mailrc.txt.tmp25321 "ftp://cpan.cse.msu.edu/authors/01mailrc.tx +t.gz" " returned status 1 (wstat 256) Warning: expected file [/Users/jimk/.cpan/sources/authors/01mailrc.txt +.gz.tmp25321] doesn't exist Trying with "/usr/local/bin/lynx -source" to get ftp://cpan.cse.msu.edu/authors/01mailrc.txt.gz Looking up cpan.cse.msu.edu Making FTP connection to cpan.cse.msu.edu Looking up 35.9.25.25:52755 Making FTP data connection to 35.9.25.25:52755 Looking up cpan.cse.msu.edu Making FTP connection to cpan.cse.msu.edu Can't Access `ftp://cpan.cse.msu.edu/authors/01mailrc.txt.gz' Alert!: Unable to access document. lynx: Can't access startfile No success, the file that lynx has downloaded is an empty file. Fetching with LWP: ftp://cpan.pair.com/pub/CPAN/authors/01mailrc.txt.gz LWP failed with code[404] message[Can't chdir to pub] Fetching with Net::FTP: ftp://cpan.pair.com/pub/CPAN/authors/01mailrc.txt.gz CPAN: YAML loaded ok (v0.66) Going to read /Users/jimk/.cpan/sources/authors/01mailrc.txt.gz CPAN: Compress::Zlib loaded ok (v2.008) ...................................................................... +......DONE Fetching with LWP: ftp://cpan.cse.msu.edu/modules/02packages.details.txt.gz LWP failed with code[404] message[Can't chdir to modules] Fetching with Net::FTP: ftp://cpan.cse.msu.edu/modules/02packages.details.txt.gz Couldn't cwd modules: modules: No such file or directory Fetching with Net::FTP ftp://cpan.cse.msu.edu/modules/02packages.details.txt.gz.gz Couldn't cwd modules: modules: No such file or directory Trying with "/usr/bin/curl -L -f -s -S --netrc-optional" to get ftp://cpan.cse.msu.edu/modules/02packages.details.txt.gz curl: (9) Server denied you to change to the given directory System call "/usr/bin/curl -L -f -s -S --netrc-optional "ftp://cpa +n.cse.msu.edu/modules/02packages.details.txt.gz" > /Users/jimk/.cpan +/sources/modules/02packages.details.txt.tmp25321" returned status 9 (wstat 2304) Warning: expected file [/Users/jimk/.cpan/sources/modules/02packages.d +etails.txt.gz.tmp25321] doesn't exist Trying with "/usr/local/bin/wget -O /Users/jimk/.cpan/sources/modules/ +02packages.details.txt.tmp25321" to get ftp://cpan.cse.msu.edu/modules/02packages.details.txt.gz --18:48:03-- ftp://cpan.cse.msu.edu/modules/02packages.details.txt.gz => `/Users/jimk/.cpan/sources/modules/02packages.details.tx +t.tmp25321' Resolving cpan.cse.msu.edu... 35.9.25.25 Connecting to cpan.cse.msu.edu[35.9.25.25]:21... connected. Logging in as anonymous ... Logged in! ==> SYST ... done. ==> PWD ... done. ==> TYPE I ... done. ==> CWD /modules ... No such directory `modules'. System call "/usr/local/bin/wget -O /Users/jimk/.cpan/sources/modu +les/02packages.details.txt.tmp25321 "ftp://cpan.cse.msu.edu/modules/0 +2packages.details.txt.gz" " returned status 1 (wstat 256) Warning: expected file [/Users/jimk/.cpan/sources/modules/02packages.d +etails.txt.gz.tmp25321] doesn't exist Trying with "/usr/local/bin/lynx -source" to get ftp://cpan.cse.msu.edu/modules/02packages.details.txt.gz Looking up cpan.cse.msu.edu Making FTP connection to cpan.cse.msu.edu Looking up 35.9.25.25:52866 Making FTP data connection to 35.9.25.25:52866 Looking up cpan.cse.msu.edu Making FTP connection to cpan.cse.msu.edu Can't Access `ftp://cpan.cse.msu.edu/modules/02packages.details.txt.gz +' Alert!: Unable to access document. lynx: Can't access startfile No success, the file that lynx has downloaded is an empty file. Fetching with LWP: ftp://cpan.pair.com/pub/CPAN/modules/02packages.details.txt.gz LWP failed with code[404] message[Can't chdir to pub] Fetching with Net::FTP: ftp://cpan.pair.com/pub/CPAN/modules/02packages.details.txt.gz Going to read /Users/jimk/.cpan/sources/modules/02packages.details.txt +.gz Database was generated on Tue, 08 Apr 2008 18:29:50 GMT ...................................................................... +......DONE Fetching with LWP: ftp://cpan.cse.msu.edu/modules/03modlist.data.gz LWP failed with code[404] message[Can't chdir to modules] Fetching with Net::FTP: ftp://cpan.cse.msu.edu/modules/03modlist.data.gz Couldn't cwd modules: modules: No such file or directory Fetching with Net::FTP ftp://cpan.cse.msu.edu/modules/03modlist.data.gz.gz Couldn't cwd modules: modules: No such file or directory Trying with "/usr/bin/curl -L -f -s -S --netrc-optional" to get ftp://cpan.cse.msu.edu/modules/03modlist.data.gz curl: (9) Server denied you to change to the given directory System call "/usr/bin/curl -L -f -s -S --netrc-optional "ftp://cpa +n.cse.msu.edu/modules/03modlist.data.gz" > /Users/jimk/.cpan/sources +/modules/03modlist.data.tmp25321" returned status 9 (wstat 2304) Warning: expected file [/Users/jimk/.cpan/sources/modules/03modlist.da +ta.gz.tmp25321] doesn't exist Trying with "/usr/local/bin/wget -O /Users/jimk/.cpan/sources/modules/ +03modlist.data.tmp25321" to get ftp://cpan.cse.msu.edu/modules/03modlist.data.gz --18:50:05-- ftp://cpan.cse.msu.edu/modules/03modlist.data.gz => `/Users/jimk/.cpan/sources/modules/03modlist.data.tmp253 +21' Resolving cpan.cse.msu.edu... 35.9.25.25 Connecting to cpan.cse.msu.edu[35.9.25.25]:21... connected. Logging in as anonymous ... Logged in! ==> SYST ... done. ==> PWD ... done. ==> TYPE I ... done. ==> CWD /modules ... No such directory `modules'. System call "/usr/local/bin/wget -O /Users/jimk/.cpan/sources/modu +les/03modlist.data.tmp25321 "ftp://cpan.cse.msu.edu/modules/03modlist +.data.gz" " returned status 1 (wstat 256) Warning: expected file [/Users/jimk/.cpan/sources/modules/03modlist.da +ta.gz.tmp25321] doesn't exist Trying with "/usr/local/bin/lynx -source" to get ftp://cpan.cse.msu.edu/modules/03modlist.data.gz Looking up cpan.cse.msu.edu Making FTP connection to cpan.cse.msu.edu Looking up 35.9.25.25:53008 Making FTP data connection to 35.9.25.25:53008 Looking up cpan.cse.msu.edu Making FTP connection to cpan.cse.msu.edu Can't Access `ftp://cpan.cse.msu.edu/modules/03modlist.data.gz' Alert!: Unable to access document. lynx: Can't access startfile No success, the file that lynx has downloaded is an empty file. Fetching with LWP: ftp://cpan.pair.com/pub/CPAN/modules/03modlist.data.gz LWP failed with code[404] message[Can't chdir to pub] Fetching with Net::FTP: ftp://cpan.pair.com/pub/CPAN/modules/03modlist.data.gz Going to read /Users/jimk/.cpan/sources/modules/03modlist.data.gz ...................................................................... +......DONE Going to write /Users/jimk/.cpan/Metadata Running install for module 'Perl::Critic'

Note: I do not have cpan.cse.msu.edu selected in my CPAN/MyConfig.pm:

$ grep -A 3 -B 3 urllist .cpan/CPAN/MyConfig.pm 'tar' => q[/usr/bin/tar], 'term_is_latin' => q[1], 'unzip' => q[/usr/bin/unzip], 'urllist' => [q[http://www.cpan.org/], q[ftp://ftp.cpan.org/pub/CPAN +/], q[ftp://mirror.cc.columbia.edu/pub/software/cpan/], q[ftp://ftp.d +uke.edu/pub/perl/], 'wget' => q[/usr/local/bin/wget], };

I know that long ago I had that msu.edu server in my list, but I definitely recall removing it. But I can't seem to get rid of it, and all the failures are associated with that mirror.

Can anyone diagnose?

Thanks in advance.

Jim Keenan

Replies are listed 'Best First'.
Re: cpan shell: Big startup delays at non-chosen mirror
by mhearse (Chaplain) on Apr 09, 2008 at 00:15 UTC
    Hmmm.... I'm unable to access the ftp://cpan.cse.msu.edu url. My suggestion is to reconfigure and select a bunch of cpan mirrors. This will allow for backup sources.
    perl -MCPAN -e shell cpan> o conf init
    I'm not sure why the mirror is still being used after you removed it. I believe the mirrow list is in the config file:
    ${HOME}/.cpan/sources/MIRRORED.BY
    You may want to try passive ftp. It didn't look like that was the problem but you could try by exporting this variable before you invoke the CPAN installer:
    export FTP_PASSIVE=1
Re: cpan shell: Big startup delays at non-chosen mirror
by Khen1950fx (Canon) on Apr 09, 2008 at 03:22 UTC
    I had the same problem recently, but I solved the problem by going retro to v1.8058 and redoing o conf init. You might have to redo conf more than once...
Re: cpan shell: Big startup delays at non-chosen mirror
by cipactli (Initiate) on Mar 26, 2009 at 21:01 UTC

    Just had this same problem, so I'll try to save some time to someone else.

    When you try o config init, do not say "yes" to "Would you like me to configure as much as possible automatically?", you'll end up with the same problem. Instead, say "no" and answer the following questions, paying attention to the point where you'll be asked what sites to use.