0
votes

I have a Mule 4 flow which connects to a SFTP location to read files, and perform a set of operations. This works fine when I run the project from Anypoint Studio. However when I deploy this, I see the following error when the projects gets deployed to cloudhub:

Connectivity test failed for config 'SFTP_Config'. Application deployment will continue. Error was: Could not establish SFTP connection with host: '...' at port: '22' - timeout: socket is not established org.mule.runtime.api.connection. ConnectionException: Could not establish SFTP connection with host: '...' at port: '22' - timeout: socket is not established at org.mule.runtime.core.internal.connection.ErrorTypeHandlerConnectionProviderWrapper.lambda$connect$0(ErrorTypeHandlerConnectionProviderWrapper.java:70) at java.util.Optional.map(Optional.java:215)

My SFTP connection config is as shown below:

<sftp:config name="SFTP_Config" doc:name="SFTP Config" doc:id="3cac96f7-4985-48eb-a4fc-77a312a6dc22" >
    <sftp:connection workingDir="${sftp.basepath}" host="${sftp.host}" username="${sftp.user}" password="${sftp.password}" port="${sftp.port}">
        <reconnection >
            <reconnect frequency="20000" count="5" />
        </reconnection>
    </sftp:connection>
</sftp:config>

Am I missing something in the connection configuration. Or is the error due to something else? Any help would be highly appreciated.

2

2 Answers

1
votes

Usually communication will fail from CloudHub when it is a private server, not accessible from the public Internet, or access requires a whitelist from the server side.

You can test if there is network connectivity deploying a test application to perform tests as described here: https://help.mulesoft.com/s/article/Network-connectivity-testing

In the first case, you need to setup a VPN from CloudHub to the network where the SFTP server resides. You may also need to setup the internal DNS if the host name is not public or not an IP.

For the second you can setup a public static IP for the worker where the application is deployed.

0
votes

Double check that your sftp.host is available from cloud.