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
When trying to use the SFTP provider to get files, I ran into a possible bug - the SftpFileValue uses Path.Combine in the GetContent method to pass a filepath to the SFTP server, however if there's no trailing path delimiter ie, Path.Combine("SomeRoot/content", "filename.txt") then Path.Combine assumes the default for the machine it is running on. This can lead to a Linux SFTP server receiving a filepath with mixed forward and back slashes, and Renci.SshNet spits out a 'No such file' exception. That sent me down a lot of wrong turns since I assumed there was something wrong with the SFTP server or the authentication since the file clearly existed.
There is an easy workaround - make sure that there are trailing slashes in the path. It feels like Path.Combine is redundant in the SftpFileValue then because it's just concatenating the strings together at that point, and the error message as it stands is not helpful in trying to track down the issue (especially since the filepath isn't included in the exception, and the bits of path on their own seem sensible when passing them in - indeed, they work to get a list of the files at that location!)
The text was updated successfully, but these errors were encountered:
When trying to use the SFTP provider to get files, I ran into a possible bug - the
SftpFileValue
usesPath.Combine
in theGetContent
method to pass a filepath to the SFTP server, however if there's no trailing path delimiter ie,Path.Combine("SomeRoot/content", "filename.txt")
thenPath.Combine
assumes the default for the machine it is running on. This can lead to a Linux SFTP server receiving a filepath with mixed forward and back slashes, and Renci.SshNet spits out a 'No such file' exception. That sent me down a lot of wrong turns since I assumed there was something wrong with the SFTP server or the authentication since the file clearly existed.There is an easy workaround - make sure that there are trailing slashes in the path. It feels like
Path.Combine
is redundant in theSftpFileValue
then because it's just concatenating the strings together at that point, and the error message as it stands is not helpful in trying to track down the issue (especially since the filepath isn't included in the exception, and the bits of path on their own seem sensible when passing them in - indeed, they work to get a list of the files at that location!)The text was updated successfully, but these errors were encountered: