Net::FTP::Recursive hangs

B

bill

Hi All,

I'm trying to use Net::FTP::Recursive 'rdir' to return recursive
directory listings.
I tried both my own version of a script, and when that did not work, I
tried the script
included in the 2.0 version of Net::FTP::Recursive. I turned on Debug,
and here is the
output (same for both scripts). The script hangs on LIST, then times
out after a few minutes.
I've ftp'ed directory to this site and verified that the directory is
there and has
sub-directories. I've done a little searching for info on the 425 eror
msg, but did not find much useful. I'm running this on Mac OS/X 10.4.8,
perl 5.8.6, Net::FTP::Recursive 2.0.

Can someone help?

Thanks, Bill

$ nftp.pl ftp.ciac.org anonymous (e-mail address removed) /pub /tmp/rec.txt
Net::FTP>>> Net::FTP(2.75)
Net::FTP>>> Exporter(5.58)
Net::FTP>>> Net::Cmd(2.26)
Net::FTP>>> IO::Socket::INET(1.27)
Net::FTP>>> IO::Socket(1.28)
Net::FTP>>> IO::Handle(1.24)
Net::FTP=GLOB(0x18ad96c)<<< 220 ciac.org FTP server ready.
Net::FTP::Recursive=GLOB(0x18ad96c)>>> user anonymous
Net::FTP::Recursive=GLOB(0x18ad96c)<<< 331 Guest login ok, send your
complete e-mail address as password.
Net::FTP::Recursive=GLOB(0x18ad96c)>>> PASS ....
Net::FTP::Recursive=GLOB(0x18ad96c)<<< 230 Guest login ok, access
restrictions apply.
Net::FTP::Recursive=GLOB(0x18ad96c)>>> TYPE I
Net::FTP::Recursive=GLOB(0x18ad96c)<<< 200 Type set to I.
Net::FTP::Recursive=GLOB(0x18ad96c)>>> CWD /pub
Net::FTP::Recursive=GLOB(0x18ad96c)<<< 250 CWD command successful.
Net::FTP::Recursive=GLOB(0x18ad96c)>>> PWD
Net::FTP::Recursive=GLOB(0x18ad96c)<<< 257 "/pub" is current directory.
Net::FTP::Recursive=GLOB(0x18ad96c)>>> PWD
Net::FTP::Recursive=GLOB(0x18ad96c)<<< 257 "/pub" is current directory.
Net::FTP::Recursive=GLOB(0x18ad96c)>>> PORT 192,168,0,10,194,78
Net::FTP::Recursive=GLOB(0x18ad96c)<<< 200 PORT command successful.
Net::FTP::Recursive=GLOB(0x18ad96c)>>> LIST
Net::FTP::Recursive=GLOB(0x18ad96c): Timeout at /Users/wmb/bin/nftp.pl
line 33

Net::FTP::Recursive=GLOB(0x18ad96c)>>> PWD
Net::FTP::Recursive=GLOB(0x18ad96c)<<< 425 Can't build data connection:
Operation already in progress.
Net::FTP::Recursive=GLOB(0x18ad96c)>>> QUIT
Net::FTP::Recursive=GLOB(0x18ad96c)<<< 257 "/pub" is current directory.
 
M

Martijn Lievaart

Hi All,

I'm trying to use Net::FTP::Recursive 'rdir' to return recursive
directory listings.
I tried both my own version of a script, and when that did not work, I
tried the script
included in the 2.0 version of Net::FTP::Recursive. I turned on Debug,
and here is the
output (same for both scripts). The script hangs on LIST, then times
out after a few minutes.
I've ftp'ed directory to this site and verified that the directory is
there and has
sub-directories. I've done a little searching for info on the 425 eror
msg, but did not find much useful. I'm running this on Mac OS/X 10.4.8,
perl 5.8.6, Net::FTP::Recursive 2.0.

Can someone help?

"Ftp hangs on LIST command" is 99% of the time related to NAT. Did you do
the ftp from the same box? Does that client have any proxy settings?

M4
 
B

bill

Hi Martin,
thanks for your reply.
Yes, ftp works fine on the same box from the command line:

]$ ftp (e-mail address removed)
Connected to ciac.org.
220 ciac.org FTP server ready.
331 Guest login ok, send your complete e-mail address as password.
Password:
230 Guest login ok, access restrictions apply.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> cd pub
250 CWD command successful.
ftp> dir
227 Entering Passive Mode (198,128,39,4,118,187)
150 Opening ASCII mode data connection for /bin/ls.
total 20
drwxrwsr-x 11 webheads 512 Sep 1 1999 ciac
drwxrwsr-x 2 webheads 512 Jan 25 2001 demo
drwxrwsr-x 2 webheads 512 Jan 26 2001 iss
drwxrwsr-x 2 webheads 512 Mar 18 2003 mptc
drwxrwsr-x 2 webheads 512 Jan 26 2001 realsecure
drwxrwsr-x 7 webheads 512 Feb 12 1996 spi
drwxrwsr-x 3 webheads 1536 Sep 24 1999 spinet
drwxrwsr-x 3 webheads 512 Dec 11 1997 spint
drwxrwxr-x 2 webheads 512 Nov 14 2003 ssds
226 Transfer complete.

I do use the firewall, with ftp passive mode ON. I do not have any
proxy servers defined (that I'm aware of). None are set in the network
manager.

Thanks, Bill
 
B

bill

I found the problem. I needed to set the 'Passive => 1' flag in the
new() cmd.
Martin, thanks for pointing me in the right direction.
- Bill
Hi Martin,
thanks for your reply.
Yes, ftp works fine on the same box from the command line:

]$ ftp (e-mail address removed)
Connected to ciac.org.
220 ciac.org FTP server ready.
331 Guest login ok, send your complete e-mail address as password.
Password:
230 Guest login ok, access restrictions apply.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> cd pub
250 CWD command successful.
ftp> dir
227 Entering Passive Mode (198,128,39,4,118,187)
150 Opening ASCII mode data connection for /bin/ls.
total 20
drwxrwsr-x 11 webheads 512 Sep 1 1999 ciac
drwxrwsr-x 2 webheads 512 Jan 25 2001 demo
drwxrwsr-x 2 webheads 512 Jan 26 2001 iss
drwxrwsr-x 2 webheads 512 Mar 18 2003 mptc
drwxrwsr-x 2 webheads 512 Jan 26 2001 realsecure
drwxrwsr-x 7 webheads 512 Feb 12 1996 spi
drwxrwsr-x 3 webheads 1536 Sep 24 1999 spinet
drwxrwsr-x 3 webheads 512 Dec 11 1997 spint
drwxrwxr-x 2 webheads 512 Nov 14 2003 ssds
226 Transfer complete.

I do use the firewall, with ftp passive mode ON. I do not have any
proxy servers defined (that I'm aware of). None are set in the network
manager.

Thanks, Bill


Martijn said:
"Ftp hangs on LIST command" is 99% of the time related to NAT. Did you do
the ftp from the same box? Does that client have any proxy settings?

M4
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,071
Latest member
MetabolicSolutionsKeto

Latest Threads

Top