Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ftp connection problem

Status
Not open for further replies.

DaveKub

Programmer
Joined
Aug 18, 2006
Messages
2
Location
US
I've got a script that has been throwing an intermittant error for the past month. Before that, it ran fine for over two years. The script connects to an ftp server and retrieves a bunch of binary files then processes them into our database. It runs once/hour and now it's failing about 50% of the time.

The error message is 'bad file number' and it's failing while attempting to connect to the remote server. The section of code where it fails is:
Code:
   my $ftp = Net::FTP->new( $ftpHost, Debug => 0 );
   
   if( ! $ftp ) {
       LogUtils::error( "Couldn't connect to '$ftpHost' ($@ : $!)" );
       print( "Couldn't connect to '$ftpHost' ($@ : $!)\n" );
       exit( -1 );
   }

And the actual message that gets logged is "Couldn't connect to 'ftp.meteorlogix.com' ( : Bad file number)".

The system it runs on is Solaris. Oddly, the exact same script runs in our dev environment just fine (connects to the same remote server, once/hour). It has also run without errors every time that I've manually run it.

Any ideas??

Dave
 
You may have to just put in logic to try again. I have several that fail, I have retry loops, and it connects and works ok.

That error is probably not related, classic reporting errors that are incorrect.
 
Looks like that error is related to a socket problem. Maybe a NIC is going bad.
 
I set the Debug value to 1 and captured the output:

Code:
Net::FTP: Net::FTP(2.65)
Net::FTP:   Exporter(5.562)
Net::FTP:   Net::Cmd(2.21)
Net::FTP:   IO::Socket::INET(1.25)
Net::FTP:     IO::Socket(1.26)
Net::FTP:       IO::Handle(1.21)

Net::FTP: Unexpected EOF on command channel at /local/rtp/rtp-0.4/bin/meteorlogix line 215
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top