Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
3.7k views
in Java FTP by (120 points)
We are using edtftpj 2.1.0 jar for our Java application which uploads files to the FTPServer on Windows. This java application is running on Linux and it first checks for the presence files in the FTPServer and then proceeds with downloading the files.
It was working for other servers but for one server it is giving a ControlIOExeption. We are trying to upload large number of files.

We are using FileTransferClient.exists method to check the presence of the each file in the FTPServer. At this point it throws ControlIOExeption BrokenPipe.
We have put Retry logic in the IOException catch block and have put timeout as 2sec. Though it proceeds further with the download of files, for each file it throws error and retries the connection. Can you please help us on this.

Please see below the log run in debug mode.


DEBUG [FTPControlSocket] 4 Jan 2012 03:31:28.527 : ---> SIZE <file_name>
DEBUG [FTPControlSocket] 4 Jan 2012 03:31:28.528 : 213 <file size>
DEBUG [FTPControlSocket] 4 Jan 2012 03:31:28.531 : ---> PASV
DEBUG [FTPControlSocket] 4 Jan 2012 03:31:28.533 : 227 Entering Passive Mode .
INFO [FTPControlSocket] 4 Jan 2012 03:31:28.533 : Substituting server supplied IP () with remote host IP ()
DEBUG [FTPControlSocket] 4 Jan 2012 03:31:28.535 : ---> RETR <file_name>
DEBUG [FTPControlSocket] 4 Jan 2012 03:31:28.537 : 125 Data connection already open; Transfer starting.
DEBUG [FTPInputStream] 4 Jan 2012 03:31:29.469 : Transferred 14720 bytes from remote host
DEBUG [FTPControlSocket] 4 Jan 2012 03:31:29.469 : 226 Transfer complete.

DEBUG [FTPControlSocket] 4 Jan 2012 03:45:28.619 : ---> SIZE
DEBUG [FTPControlSocket] 4 Jan 2012 03:45:28.619 : 421 Timeout (120 seconds): closing control connection.
DEBUG [FTPClient] 4 Jan 2012 03:45:28.619 : SIZE not supported - trying MDTM
DEBUG [FTPControlSocket] 4 Jan 2012 03:45:28.619 : ---> MDTM
DEBUG [FTPControlSocket] 4 Jan 2012 03:45:28.619 : 421 Terminating connection.
DEBUG [FTPClient] 4 Jan 2012 03:45:28.619 : MDTM not supported - trying LIST
DEBUG [FTPControlSocket] 4 Jan 2012 03:45:28.623 : ---> SYST
04/01/2012 03:45:28 PST Received signal: SIGPIPE
DEBUG [FTPClient] 4 Jan 2012 03:45:29.257 : Class: com.enterprisedt.net.ftp.FTPClient


DEBUG [FileTransferClient] 4 Jan 2012 03:45:29.267 : Logged in
DEBUG [FTPControlSocket] 4 Jan 2012 03:45:29.268 : ---> TYPE I
DEBUG [FTPControlSocket] 4 Jan 2012 03:45:29.269 : 200 Type set to I.
DEBUG [FTPControlSocket] 4 Jan 2012 03:58:32.704 : ---> SIZE <file_name>
DEBUG [FTPControlSocket] 4 Jan 2012 03:58:32.705 : 21
DEBUG [FTPControlSocket] 4 Jan 2012 03:58:32.725 : ---> PASV
ERROR [FTPClient] 4 Jan 2012 03:58:32.727 : Caught and rethrowing exception in initGet() : Broken pipe
com.enterprisedt.net.ftp.ControlChannelIOException: Broken pipe
at com.enterprisedt.net.ftp.FTPControlSocket.writeCommand(FTPControlSocket.java:1008)
at com.enterprisedt.net.ftp.FTPControlSocket.sendCommand(FTPControlSocket.java:985)
at com.enterprisedt.net.ftp.FTPControlSocket.createDataSocketPASV(FTPControlSocket.java:818)
at com.enterprisedt.net.ftp.FTPControlSocket.createDataSocket(FTPControlSocket.java:574)
at com.enterprisedt.net.ftp.FTPClient.setupDataSocket(FTPClient.java:2572)
at com.enterprisedt.net.ftp.FTPClient.initGet(FTPClient.java:3000)
at com.enterprisedt.net.ftp.FTPClient.getData(FTPClient.java:3092)
at com.enterprisedt.net.ftp.FTPClient.get(FTPClient.java:3251)
at com.enterprisedt.net.ftp.FileTransferClient.downloadByteArray(FileTransferClient.java:666)


com.enterprisedt.net.ftp.ControlChannelIOException: Broken pipe
at com.enterprisedt.net.ftp.FTPControlSocket.writeCommand(FTPControlSocket.java:1008)
at com.enterprisedt.net.ftp.FTPControlSocket.sendCommand(FTPControlSocket.java:985)
at com.enterprisedt.net.ftp.FTPControlSocket.createDataSocketPASV(FTPControlSocket.java:818)
at com.enterprisedt.net.ftp.FTPControlSocket.createDataSocket(FTPControlSocket.java:574)
at com.enterprisedt.net.ftp.FTPClient.setupDataSocket(FTPClient.java:2572)
at com.enterprisedt.net.ftp.FTPClient.initGet(FTPClient.java:3000)
at com.enterprisedt.net.ftp.FTPClient.getData(FTPClient.java:3092)
at com.enterprisedt.net.ftp.FTPClient.get(FTPClient.java:3251)
at com.enterprisedt.net.ftp.FileTransferClient.downloadByteArray(FileTransferClient.java:666)
DEBUG [FTPClient] 4 Jan 2012 03:58:33.337 : Class: com.enterprisedt.net.ftp.FTPClient
DEBUG [FileTransferClient] 4 Jan 2012 03:58:33.456 : Logged in
DEBUG [FTPControlSocket] 4 Jan 2012 03:58:33.456 : ---> TYPE I
DEBUG [FTPControlSocket] 4 Jan 2012 03:58:33.457 : 200 Type set to I.
DEBUG [FTPControlSocket] 4 Jan 2012 03:58:33.457 : ---> PASV
DEBUG [FTPControlSocket] 4 Jan 2012 03:58:33.459 : 227 Entering Passive Mode
DEBUG [FTPControlSocket] 4 Jan 2012 03:58:33.461 : ---> RETR <file_name>
DEBUG [FTPControlSocket] 4 Jan 2012 03:58:33.470 : 125 Data connection already open; Transfer starting.
DEBUG [FTPControlSocket] 4 Jan 2012 03:58:33.558 : ---> PASV
ERROR [FTPClient] 4 Jan 2012 03:58:33.558 : Caught and rethrowing exception in initGet() : Broken pipe
com.enterprisedt.net.ftp.ControlChannelIOException: Broken pipe
at com.enterprisedt.net.ftp.FTPControlSocket.writeCommand(FTPControlSocket.java:1008)
at com.enterprisedt.net.ftp.FTPControlSocket.sendCommand(FTPControlSocket.java:985)
at com.enterprisedt.net.ftp.FTPControlSocket.createDataSocketPASV(FTPControlSocket.java:818)
at com.enterprisedt.net.ftp.FTPControlSocket.createDataSocket(FTPControlSocket.java:574)
at com.enterprisedt.net.ftp.FTPClient.setupDataSocket(FTPClient.java:2572)
at com.enterprisedt.net.ftp.FTPClient.initGet(FTPClient.java:3000)
at com.enterprisedt.net.ftp.FTPClient.getData(FTPClient.java:3092)
at com.enterprisedt.net.ftp.FTPClient.get(FTPClient.java:3251)
at com.enterprisedt.net.ftp.FileTransferClient.downloadByteArray(FileTransferClient.java:666)

1 Answer

0 votes
by (162k points)
It may be that your connection has timed out - there's an error message:

421 Timeout (120 seconds): closing control connection.

So the server has timed out the client.

Categories

...