CloudHub worker 尝试连接到仅允许白名单 IP 的 SFTP 站点

huangapple go评论58阅读模式
英文:

CloudHub worker trying to connect to SFTP site which allows whitelisted IPs only

问题

我有一个在CloudHub上创建的Mule 4应用程序[App1]。我尝试将该应用程序的jar文件部署到CloudHub上。此应用程序在Runtime Manager中分配了一个静态IP [例如100.101.102.103]。此IP地址已由客户白名单列入,以允许与其SFTP站点和API的通信。我的Mule应用程序具有API和一些SFTP流。当我尝试部署我的Mule应用程序[App1]时,部署失败,错误如下:

配置 'SFTP_Config' 的连接测试失败。应用程序部署将继续。错误为:无法与主机 'sftp.hostname' 在端口 '22' 上建立SFTP连接 - 在 'sftpuser@sftp.hostname' 登录时出错。

SFTP配置如下:

<sftp:config name="SFTP_Config" doc:name="SFTP Config" doc:id="5d626288-5181-41d5-807d-2786ea4292d8">
    <sftp:connection host="${sftp.host}" port="${sftp.port}" username="${secure::sftp.username}" password="${secure::sftp.password}" connectionTimeoutUnit="MINUTES" connectionTimeout="2" responseTimeoutUnit="MINUTES" responseTimeout="2" workingDir="${sftp.peoplePosition.directory}">
        <reconnection failsDeployment="false">
            <reconnect frequency="${sftp.retryInterval}" count="${sftp.retryAttempts}" />
        </reconnection>
    </sftp:connection>
</sftp:config>

我还尝试在SFTP配置中使用failsDeployment="false",如此KB文章中建议的那样,但也没有奏效。

日志显示:

[2023-02-16 05:59:00.754] ERROR   
org.mule.extension.sftp.internal.connection.SftpConnectionProvider 
[qtp1351434790-36]: Auth fail
com.jcraft.jsch.JSchException: Auth fail

[2023-02-16 05:59:00.824] WARN 
org.mule.runtime.core.internal.connection.
PoolingConnectionManagementStrategy 
[qtp1351434790-36]: Failed to create a connection while 
applying the pool initialization policy.
org.mule.runtime.api.connection.ConnectionException: 
Could not establish SFTP connection with host: 'sftphost' at port: '22' 
- Error during login to sftpuser@sftphost
at 
 org.mule.runtime.core.internal.connection.ErrorTypeHandler
ConnectionProviderWrapper.lambda$connect$0(ErrorTypeHandler
ConnectionProviderWrapper.java:70)
at java.util.Optional.map(Optional.java:215)

我已验证了SFTP凭据,它们在Winscp中正常工作。

是否有任何方法可以使CloudHub的工作节点成功完成部署,或者可以使用静态IP验证SFTP配置,而不是使用自己的IP地址?

英文:

I have a Mule 4 application [App1] created on CloudHub. I tried to deploy the application's jar file onto CloudHub. This application has a Static IP [eg. 100.101.102.103] assigned to it in Runtime Manager. This IP address is whitelisted by customer to allow communication with their SFTP sites and APIs. My Mule application has APIs and some SFTP flows. When I try to deploy my mule application [App1], the deployment fails with below error:

Connectivity test failed for config &#39;SFTP_Config&#39;. Application deployment will continue. Error was: Could not establish SFTP connection with host: &#39;sftp.hostname&#39; at port: &#39;22&#39; - Error during login to &#39;sftpuser@sftp.hostname&#39;.

The SFTP Config is:

	&lt;sftp:config name=&quot;SFTP_Config&quot; doc:name=&quot;SFTP Config&quot; doc:id=&quot;5d626288-5181-41d5-807d-2786ea4292d8&quot; &gt;
	&lt;sftp:connection host=&quot;${sftp.host}&quot; port=&quot;${sftp.port}&quot; username=&quot;${secure::sftp.username}&quot; password=&quot;${secure::sftp.password}&quot; connectionTimeoutUnit=&quot;MINUTES&quot; connectionTimeout=&quot;2&quot; responseTimeoutUnit=&quot;MINUTES&quot; responseTimeout=&quot;2&quot; workingDir=&quot;${sftp.peoplePosition.directory}&quot;&gt;
		&lt;reconnection failsDeployment=&quot;false&quot; &gt;
			&lt;reconnect frequency=&quot;${sftp.retryInterval}&quot; count=&quot;${sftp.retryAttempts}&quot; /&gt;
		&lt;/reconnection&gt;
	&lt;/sftp:connection&gt;
&lt;/sftp:config&gt;

I also tried using failsDeployment=&quot;false&quot; in the SFTP configuration as recommended in this KB article
but it didn't work either.

The log shows:

[2023-02-16 05:59:00.754] ERROR   
org.mule.extension.sftp.internal.connection.SftpConnectionProvider 
[qtp1351434790-36]: Auth fail
com.jcraft.jsch.JSchException: Auth fail

[2023-02-16 05:59:00.824] WARN 
org.mule.runtime.core.internal.connection.
PoolingConnectionManagementStrategy 
[qtp1351434790-36]: Failed to create a connection while 
applying the pool initialization policy.
org.mule.runtime.api.connection.ConnectionException: 
Could not establish SFTP connection with host: &#39;sftphost&#39; at port: &#39;22&#39; 
- Error during login to sftpuser@sftphost
at 
 org.mule.runtime.core.internal.connection.ErrorTypeHandler
ConnectionProviderWrapper.lambda$connect$0(ErrorTypeHandler
ConnectionProviderWrapper.java:70)
at java.util.Optional.map(Optional.java:215)

I have verified the SFTP credentials, they are working fine with Winscp.

Is there any way a CloudHub worker can complete the deployment successfully or validate the SFTP configuration using Static IP instead of it's own IP address?

答案1

得分: 1

在将以下内容添加到应用程序的运行时属性之后,应用程序成功部署:

doTestConnectivity=False
英文:

After adding following to Runtime properties of the application, the application was getting deployed successfully:

doTestConnectivity=False

huangapple
  • 本文由 发表于 2023年2月16日 13:17:37
  • 转载请务必保留本文链接:https://go.coder-hub.com/75468113.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定