Closed cassis163 closed 6 months ago
Caused by: java.io.UncheckedIOException: Cannot check 'lstat' for path to_wms/orders/15408213_Canonical.json
Maybe there is supposed to be some permission enabled for such a command?
@cassis163 ,
Please, take a look here: https://github.com/spring-projects/spring-integration/issues/9123.
Sounds like similar problem to yours when you try to remoteFileTemplate.get()
.
Caused by: SFTP error (SSH_FX_NO_SUCH_PATH): The file path does not exist or is invalid.
at org.apache.sshd.sftp.client.impl.AbstractSftpClient.throwStatusException(AbstractSftpClient.java:277)
at org.apache.sshd.sftp.client.impl.AbstractSftpClient.checkAttributesResponse(AbstractSftpClient.java:333)
at org.apache.sshd.sftp.client.impl.AbstractSftpClient.checkAttributes(AbstractSftpClient.java:325)
at org.apache.sshd.sftp.client.impl.AbstractSftpClient.lstat(AbstractSftpClient.java:1010)
at org.springframework.integration.sftp.session.SftpSession.exists(SftpSession.java:191)
Looks like this one has to use a canonicaPath()
as well.
Will fix it shortly.
In what version(s) of Spring Integration are you seeing this issue?
6.2.4
Describe the bug During the development of a custom backup advice, I encountered the 'SSH_FX_NO_SUCH_PATH' SFTP error. The strange thing is that when I connect to the SFTP-server locally, it works fine. But it malfunctions when my Spring Boot project runs inside of a Linux Docker container. Yes, it is a classic 'it works on my machine' type of problem, but after quite a bit of debugging, I still have not found the issue.
The path used for checking if the file exists and eventually for its retrieval is
to_wms/orders/15408213_Canonical.json
. Prepending this path with '/' is something that I have also tried.Honestly, I'm not sure if this is actually a bug. It might very well be misconfiguration on my part.
Here are some things that I have tried, but to no avail:
session.readRaw
This is my backup method:
Here is the stack trace:
To Reproduce
Use the SftpRemoteFileTemplate inside of an advice in a Linux Docker container and try to call either the
exists
orget
method.Expected behavior
The file should be retrieved succesfully.