Not able to FTP the files to a FTP server

Hi ,

We are facing a weird problem in our project. we need to send some xml & audio files to a remote FTP server from a Linux box, we are doing this in Perl script using Net::FTP->. Issue here is.. when FTPed the files using Perl scripts, only empty files ( 0 byte) are getting created on the remote server and data is not getting written onto the server. But we are able to manually transfer files to FTP server through a FTP tool but they fail when we try to do the same through Perl script. We checked on the remote server and there is a lot of free space on the server.

Our script is returning 'Bad File Descriptor' error where as it is working fine for all the rest of the other 50 FTP servers we have.

Any help /inputs regards this issue would be greatly appreciated.

Thanks

Hello, you have done the fisrt good steps for troubleshooting this issue. It seems that only the perl script cannot interact properly with this FTP server and this OS, the remote one. Please let us know the versions of the OS, FTPD and post some perl code, if possible. Looks like a compatibility issue, since the script is working against other OSes and some other FTP servers. It is important to answer the following questions as well - Have I changed the script, what OSes and FTP servers my script works with, and what's the difference on the remote end, in this particular task. Can you execute the same task against other machine ? Are there any special characters or Windows-like paths in the script ? I have seen "bad file descriptor" with either corrupted test source file, or against Windows FTP - I was missing the correct Windows path represenation. HTH.

Hi, Thaks for your quick response.

Our Linux box OS ---> Red Hat Enterprise Linux 2.4.21-47.0.1 (release 3 )
Remote FTP server OS ---> Ubuntu 6.06.1

Below is Perl code,which we are using to connect to remote FTP server and to transfer the files.

eval { $ftp = Net::FTP->new($remoteServerIP, Debug => 0) or $exitModule='TRUE' };
if ($@ or $exitModule eq 'TRUE') {

 log_error\("ERROR: Failed to connect to " \) ;
 eval \{ $ftp->close\(\) \}

}else{
eval { $ftp -> login($User,$Pwd) or $exitModule='TRUE' };
if ($@ or $exitModule eq 'TRUE') {
log_error ("ERROR: (" . $ftp->message . ") Failed to login");
eval { $ftp->close()}
}else{
eval { $ftp->put($sourceFile , $targetFile) or $status = 'ERROR' };
my $ftp_message = $ftp->message;
if ($@ or $status eq 'ERROR') {
log_error ("WARNING: (" . $ftp_message . ") Error during transmission");
}
}
};

We are getting the error "WARNING: Failed to transfer file. Error during transmission" (when tried to push the files using above Perl code) since two months before that we were able to transfer the files. We haven't made any changes on our server and remote severt for the last 12 months. We are not able to figure out what suddenly causing the issue.

Thanks.