Symptom

When executing a process which contains an FTP action, an error is raised by the FTP action, similar to this one:

java.net.SocketException: Connection reset
                at java.net.SocketInputStream.read(SocketInputStream.java:168)
                at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(StreamDecoder.java:452)
                at sun.nio.cs.StreamDecoder$CharsetSD.implRead(StreamDecoder.java:494)
                at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:222)
                at java.io.InputStreamReader.read(InputStreamReader.java:177)
                at java.io.BufferedReader.fill(BufferedReader.java:136)
                at java.io.BufferedReader.readLine(BufferedReader.java:299)
                at java.io.BufferedReader.readLine(BufferedReader.java:362)
                at org.apache.commons.net.ftp.FTPFileEntryParserImpl.readNextEntry(FTPFileEntryParserImpl.java:53)
                at org.apache.commons.net.ftp.FTPListParseEngine.readStream(FTPListParseEngine.java:157)
                at org.apache.commons.net.ftp.FTPListParseEngine.readServerList(FTPListParseEngine.java:100)
                at org.apache.commons.net.ftp.FTPClient.initiateListParsing(FTPClient.java:2303)
                at org.apache.commons.net.ftp.FTPClient.initiateListParsing(FTPClient.java:2269)
                at org.apache.commons.net.ftp.FTPClient.listFiles(FTPClient.java:2046)
                at org.apache.commons.net.ftp.FTPClient.listFiles(FTPClient.java:2093)
                at com.indy.engine.actionCodes.FtpGetActionCodeI.executeSimpleCode(SourceFile:390)
                at com.indy.engine.action.common.ActionCodeTypeI.executeCode(SourceFile:1646)
                at com.indy.engine.action.common.ActionCodeTypeI.run(SourceFile:1805)
                at java.lang.Thread.run(Thread.java:738)

The FTP server is up and running.

Solution

This can happen when the FTP server is busy and takes some time to respond, resulting in a timeout. This may occur when establishing the FTP connection (connection timeout), or when trying to get/send files (data timeout).

The solution is to increase the "Connection Timeout" and "Data Timeout" on the FTP action. They are expressed in milliseconds. For example 10000 means 10 seconds.