Contact Us 1-800-596-4880

Troubleshooting FTP Connector

To troubleshoot Anypoint Connector for FTP (FTP Connector), become familiar with the information about troubleshooting Mule application issues.

Troubleshoot Mule Application Issues

Sometimes you are not sure why the application is failing and you require a better understanding of what is going on in the app’s interaction with the FTP server.

To resolve this error:

  • Use the configuration file to increase the logging level on the server side.

  • Try to replicate the issue using an FTP client, for example, Cyberduck or Filezilla. If the issue also occurs with these clients, then it is likely that the issue is not related to the Mule app.

  • Get better and more detailed logs on the Mule app side by enabling verbose logging for FTP Connector and for the JSCH driver:

    1. Access Anypoint Studio and navigate to the Package Explorer view.

    2. Open your application’s project name.

    3. Open the src/main/resources path folder.

    4. Open the log4j2.xml file inside the folder.

    5. If the following lines are already in the log4j2.xml file, uncomment them to enable them. Otherwise, add them:

          <AsyncLogger name="org.mule.connectors.ftp" level="TRACE"/>
          <AsyncLogger name="com.mulesoft.connectors.ftp.commons" level="TRACE"/>
          <AsyncLogger name="org.apache.commons.net" level="DEBUG"/>
    6. Add the following argument to your run configuration:

      `-M-Djavax.net.debug=ssl,handshake`
  • Try to minimize or remove unnecessary DataWeave data transformations (you could even use hard-coded data) to minimize the app’s complexity and determine whether the issue is with the interaction between the app and the FTP server.

For additional information about enabling verbose logging for SDK components in your Mule application, see the troubleshoot SDK components documentation.

Understand Common Throws

Here is a list of common throw messages and how to interpret them.

  • FTP:ACCESS_DENIED

An FTP Connector operation attempted to access an FTP server path and performed an action for which the user doesn’t have permission. The connector raises this error when the server rejects Read, Write, Delete, List, Rename, or Create Directory with reply code 450, 550, or 553 and the reply text indicates missing permission, for example Permission denied. A Write operation that the server denies fails immediately with this error. When the server refuses to create a directory with reply code 450, 550, or 553 and a reply text that doesn’t explain the cause, for example 550 Create directory operation failed., the connector also raises this error. This applies to Create Directory and to parent directories that Write, Copy, and Move create.

  • FTP:CONNECTIVITY

The connection to the FTP server was interrupted. This error is also raised when the HTTPS tunnel proxy presents an untrusted certificate, and when Working Directory exists but the server refuses to change to it.

  • FTP:FILE_DOESNT_EXIST

The configured Working Directory (workingDir) does not exist on the FTP server. The connection fails when it is established. This error is a child of FTP:CONNECTIVITY.

  • FTP:FILE_IS_NOT_DIRECTORY

The configured Working Directory (workingDir) is a file, not a directory. The connection fails when it is established. This error is a child of FTP:CONNECTIVITY.

  • FTP:FILE_ALREADY_EXISTS

An attempt was made to create a file with the same location and name as an existing file.

  • FTP:FILE_LOCK

An attempt to lock a file was unsuccessful. The Delete operation also raises this error when the file is locked by another operation in the app, for example a Read operation with Lock set to true.

  • FTP:ILLEGAL_CONTENT

The Write operation received invalid content to write.

  • FTP:ILLEGAL_PATH

The specified path is invalid because, for example, it does not exist. The connector also raises this error when the server rejects the action with reply code 450, 550, or 553 and the reply text indicates a missing file, for example No such file or directory, and when the directory of the On New or Updated File source does not exist when the source starts.

If the server reply text doesn’t indicate either missing permission or a missing file, the connector raises a generic error instead of FTP:ACCESS_DENIED or FTP:ILLEGAL_PATH.

When the server reply starts with the path followed by a colon, the connector classifies the error using only the text after the path. A relative path that contains spaces isn’t recognized as a path, so the whole reply text is used. If that text contains words the connector uses as hints, the error type can be wrong.

  • FTP:RETRY_EXHAUSTED

Retries of an execution block are exhausted.