You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In what version(s) of Spring Integration are you seeing this issue?
6.0
Describe the bug
When calling the SFTPSession.append() method, the application returns a SSH_FX_NO_SUCH_FILE. I've tried with the file already created in the SFTP server, and I've tried also with the method write and then trying to append but the append method throws the same error.
I've been looking into the code and I think that a flag is missing:
In the flags the SftpClient.OpenMode.Write is missing. I've tried the same exact code but with that added flag and it works that way with the intended functionality (appending to a file).
To Reproduce
Create a sample application connected to a SFTP Server and trying to use the method SFTPSession.append().
Expected behavior
The expected behavior would be for the content to be appended to a file already existing, or to create a new file with the content if such file doesn't exist.
The actual behavior is the fail I've mentioned earlier.
The text was updated successfully, but these errors were encountered:
Fixesspring-projects#8566
Turns out some SFTP servers are strict enough to not let to append into existing file
if we don't give in addition a `Write` open mode flag as well
**Cherry-pick to `6.0.x`**
Fixes#8566
Turns out some SFTP servers are strict enough to not let to append into existing file
if we don't give in addition a `Write` open mode flag as well
**Cherry-pick to `6.0.x`**
Fixes#8566
Turns out some SFTP servers are strict enough to not let to append into existing file
if we don't give in addition a `Write` open mode flag as well
**Cherry-pick to `6.0.x`**
In what version(s) of Spring Integration are you seeing this issue?
6.0
Describe the bug
When calling the SFTPSession.append() method, the application returns a SSH_FX_NO_SUCH_FILE. I've tried with the file already created in the SFTP server, and I've tried also with the method write and then trying to append but the append method throws the same error.
I've been looking into the code and I think that a flag is missing:
@OverRide
public void append(InputStream inputStream, String destination) throws IOException {
synchronized (this.sftpClient) {
OutputStream outputStream =
this.sftpClient.write(destination, SftpClient.OpenMode.Create, SftpClient.OpenMode.Append);
FileCopyUtils.copy(inputStream, outputStream);
}
}
In the flags the SftpClient.OpenMode.Write is missing. I've tried the same exact code but with that added flag and it works that way with the intended functionality (appending to a file).
To Reproduce
Create a sample application connected to a SFTP Server and trying to use the method SFTPSession.append().
Expected behavior
The expected behavior would be for the content to be appended to a file already existing, or to create a new file with the content if such file doesn't exist.
The actual behavior is the fail I've mentioned earlier.
The text was updated successfully, but these errors were encountered: