I am wondering if there were any changes between builds 6821 and 7077 of Rebex SFTP that could affect the behavior of either of the following:
(1) Sftp.CreateDirectoryAsync, causing it to return false when it used to return true (or maybe when it used to throw an exception?)
(2) Sftp.IsConnected, causing it to return true when it used to return false
Our team uses Rebex SFTP to communicate with a third-party SFTP server, and we recently upgraded from build 6821 to 7077. Since deploying the new version, the third party has reported to us that they are intermittently seeing large numbers of failures on an Add Directory operation coming from our client. At the times when they see the failures on their end, our logs show a large number of Rebex.Net.SftpException with the message "Failure; General failure."
The basic logic in our SFTP client application is the following:
- Check that client is still connected using
Sftp.IsConnected (if false, skip all of the following steps)
- Check if directory exists using
- If directory does not exist, create it using
- Upload file to directory
- Repeat (up to a couple hundred times)
On analyzing our logs, I believe
Sftp.DirectoryExistsAsync sometimes returns
false when the directory already exists. So then we call
Sftp.CreateDirectoryAsync, but of course that fails. This issue is intermittent and the network infrastructure in this environment has been somewhat unstable in the past, so it's likely that the connection has failed in some way when all of this happens. My theory is that either
Sftp.IsConnected used to return false and now it returns true, or
Sftp.DirectoryExistsAsync used to return true and now it returns false. But I'm not sure how to work around this to fix the errors.
What I am trying to figure out is:
(1) Why all of these errors only started cropping up after we updated to a newer version of the library
(2) And more importantly, how we can eliminate them. (We have been told we are spamming the server's logs.)
Any ideas? Thanks in advance!