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.