2004-06-20:
perl CPAN Timeouts

I started seeing this error when I used CPAN to fetch stuff:
Fetching with LWP:
  ftp://ftp.planetmirror.com/pub/perl/CPAN/modules/02packages.details.txt.gz
LWP failed with code[400] message[FTP return code 000]
Fetching with Net::FTP:
  ftp://ftp.planetmirror.com/pub/perl/CPAN/modules/02packages.details.txt.gz
Couldn't fetch 02packages.details.txt.gz from ftp.planetmirror.com
Fetching with LWP:
  ftp://cpan.nas.nasa.gov/pub/perl/CPAN/modules/02packages.details.txt.gz
LWP failed with code[400] message[FTP return code 000]
Fetching with Net::FTP:
  ftp://cpan.nas.nasa.gov/pub/perl/CPAN/modules/02packages.details.txt.gz
Couldn't fetch 02packages.details.txt.gz from cpan.nas.nasa.gov
Fetching with LWP:
  ftp://cpan.llarian.net/pub/CPAN/modules/02packages.details.txt.gz
The fix is simple but not particularly easy to track down.

This is likely happening because you are behind a NAT or firewall, and you need to do ftp in passive mode.

Find your perls libnet.cfg file:

% locate libnet.cfg
/usr/local/share/perl/5.6.1/Net/libnet.cfg
Edit that file and change the ftp_int_passive setting to 1.


Back to Solutions.

DaveSource.com - Dave's geek site GetDave.com - all the current Dave Pointers. MarginalHacks - I have an elegant script for that, but it's too small to fit in the margin.