如何修复骡子4 SFTP路径不存在错误?



我们在Mule 4.3.0运行时中部署了一个Mule 4应用程序,它使用的是1.3.10版本的SFTP连接器,我们得到了错误path '/source' doesn't exist。它一直抛出相同的错误,直到应用程序重新启动。重新启动应用程序后,错误就会消失。我们检查了SFTP服务器团队,他们没有看到任何错误。我们的代码配置如下所示

<sftp:config name="SFTP_Config" doc:name="SFTP Config"
doc:id="bed7b1d1-8f07-4e64-bb10-c4ddbd0e13ad">
<sftp:connection host="${sftp.host}"
port="${sftp.port}" username="${sftp.username}"
identityFile="${sftp-keystore.location}"
passphrase="${sftp.key.passphrase}"
connectionTimeout="${sftp.connection-timeout.seconds}"
responseTimeout="${sftp.response-timeout.seconds}" />
</sftp:config>
<sftp:matcher name="File_Matcher" doc:name="Matcher"
doc:id="a214a0ce-be90-470a-a658-e506c537f0d2"
filenamePattern="${sftp.filename.pattern}" directories="EXCLUDE" />
<until-successful
maxRetries="${sftp.request.number-of-retry}"
doc:name="Until Successful"
doc:id="4b646e64-2084-43e1-b609-a49981589e34"
millisBetweenRetries="${sftp.request.retry-interval}">
<sftp:list doc:name="List files from SFTP"
doc:id="61a5c497-a9bb-4c51-941c-868f8974b4f0"
config-ref="SFTP_Config" directoryPath="${sftp.pickup.filepath}"
matcher="File_Matcher">
<reconnect-forever
frequency="${sftp.reconnection.frenquency}"></reconnect-forever>
</sftp:list>
</until-successful>

错误如下:

Root Exception stack trace:
Path '/source' doesn't exist
at org.mule.extension.file.common.api.command.AbstractFileCommand.pathNotFoundException(AbstractFileCommand.java:176)
at org.mule.extension.sftp.internal.command.SftpCommand.getFile(SftpCommand.java:99)
at org.mule.extension.sftp.internal.command.SftpCommand.getExistingFile(SftpCommand.java:71)
at org.mule.extension.sftp.internal.command.SftpListCommand.list(SftpListCommand.java:77)
at org.mule.extension.file.common.api.AbstractFileSystem.list(AbstractFileSystem.java:112)
at org.mule.extension.file.common.api.BaseFileSystemOperations$1.initializePagingProvider(BaseFileSystemOperations.java:149)
at org.mule.extension.file.common.api.BaseFileSystemOperations$1.getPage(BaseFileSystemOperations.java:133)
at org.mule.extension.file.common.api.BaseFileSystemOperations$1.getPage(BaseFileSystemOperations.java:124)
at org.mule.runtime.module.extension.internal.runtime.streaming.PagingProviderWrapper.getPage(PagingProviderWrapper.java:79)
at org.mule.runtime.module.extension.internal.runtime.streaming.PagingProviderProducer.withConnection(PagingProviderProducer.java:147)
at org.mule.runtime.module.extension.internal.runtime.streaming.PagingProviderProducer.lambda$performWithConnection$1(PagingProviderProducer.java:121)
at net.jodah.failsafe.Functions.lambda$promiseOfStage$8(Functions.java:193)

可能是重连错误。如果您有企业版,请尝试使用最新的连接器、最新版本的Mule和最新的累积补丁。