Author: Ashutosh Tripathi
In all Mule applications deployed to CloudHub 2.0 with the default FTP connector configuration, an intermittent error occurs. The error message received is “FTP response 421 received. Server closed connection.” Although re-connection strategy defined in the FTP connector helps in reconnecting, the task is to resolve this error completely and prevent it from appearing in the logs.
This blog provides a step-by-step approach on how to overcome the intermittently occurring FTP connector error, along with the constraints that may arise after applying the solution.
The detailed error description is as follows.
An exception was found while attempting to change the transfer mode to class org.mule.extension.ftp.api.ftp.FtpTransferMode. The FTP reply code is 421, and the error is caused by org.apache.commons.net.ftp.FTPConnectionClosedException: FTP response 421 received. Server closed connection.
Steps to resolve the error:
- Update the FTP connector to the latest version (1.8.3).
- To disable the pooling profile for the FTP connector, follow these steps:
- Open the FTP connector configuration.
- Inside the General section, click on the Advanced tab.
- Slide the bar to the bottom, where you will find the Pooling profile option.
- Refer to the screenshot below for further guidance.
- Instead of the default pooling configuration, click on the drop-down and select the “Edit inline” option. Then, make the following changes as shown in the screenshot below to update the values to 0, ensuring that no connection remains active when there is nothing to transfer.
Points to remember:
- Before making the above configuration changes, it is important to take the time to read about the significance of each field mentioned in the pooling configuration via the Mule FTP connector documentation. Failure to do so and changing random field values without proper understanding may negatively impact performance.
- Considering the load on the application, please perform the above configuration changes, taking into account that in the current scenario, setting up multiple instances of connection with the FTP server may not be possible.