0 votes
by (120 points)

We are facing intermittent issue with file upload using Rebex version 2017 R2
Info: Assembly: Rebex.Sftp 2017 R2 for .NET 4.0-4.6. We are running our application on .net 6 framework. Below are some Rebex logs of the issue.

2023-12-04 13:14:13.522 INFO Sftp(41)[46] Info: Assembly: Rebex.Sftp 2017 R2 for .NET 4.0-4.6
2023-12-04 13:14:13.538 INFO Sftp(41)[46] SSH: Negotiation started.
2023-12-04 13:14:13.559 INFO Sftp(41)[46] SSH: Negotiation finished.
2023-12-04 13:14:13.559 INFO Sftp(41)[46] Info: Server: SSH-2.0-OpenSSH_7.4
2023-12-04 13:14:13.559 INFO Sftp(41)[46] Info: Fingerprint 
2023-12-04 13:14:13.559 INFO Sftp(41)[46] Info: Fingerprint
2023-12-04 13:14:13.559 INFO Sftp(41)[46] Info: Cipher info: SSH 2.0, diffie-hellman-group-exchange-sha256, rsa-sha2-256, aes256-ctr/aes256-ctr, hmac-sha2-256/hmac-sha2-256
2023-12-04 13:14:13.866 INFO Sftp(41)[46] Command: SSH_FXP_INIT (4)
2023-12-04 13:14:13.913 INFO Sftp(41)[46] Response: SSH_FXP_VERSION (3, 5 extensions)
2023-12-04 13:14:13.913 INFO Sftp(41)[46] Info: Using SFTP v3 on a Unix-like platform.
2023-12-04 13:14:13.913 INFO Sftp(41)[46] Command: SSH_FXP_REALPATH (1, '.')
2023-12-04 13:14:13.913 INFO Sftp(41)[46] Response: SSH_FXP_NAME (1, 1 item)
2023-12-04 13:14:13.913 INFO Sftp(41)[46] Info: Current directory is '/home/test'.
2023-12-04 13:14:13.913 INFO Sftp(41)[46] Command: SSH_FXP_REALPATH (2, '/sys3/test/')
2023-12-04 13:15:34.147 ERROR Sftp(43)[80] SSH: Rebex.Net.SshException: The operation was not completed within the specified time limit.
   at Rebex.Net.SshSession.DGT[Q,T](HLG`2 Q, Int32 T, NLG B, T I, Q U, Q M)
   at Rebex.Net.SshSession.DGT[Q,T](HLG`2 Q, T T)
   at Rebex.Net.SshChannel.BB[Q,T](HLG`2 Q, T T)
   at Rebex.Net.SshChannel.Receive(Byte[] buffer, Int32 offset, Int32 count)
2023-12-04 13:15:34.147 ERROR Sftp(43)[80] Info: Rebex.Net.SshException: The operation was not completed within the specified time limit.
   at Rebex.Net.SshSession.DGT[Q,T](HLG`2 Q, Int32 T, NLG B, T I, Q U, Q M)
   at Rebex.Net.SshSession.DGT[Q,T](HLG`2 Q, T T)
   at Rebex.Net.SshChannel.BB[Q,T](HLG`2 Q, T T)
   at Rebex.Net.SshChannel.Receive(Byte[] buffer, Int32 offset, Int32 count)
   at Rebex.Net.YFG.GT(Byte[] Q, Int32 T, Int32 B)
   at Rebex.Net.HDG.OB(Int32 Q)
   at Rebex.Net.HDG.PB(YR& Q)
   at Rebex.Net.HDG.PB(UInt32 Q, Boolean T)
   at Rebex.Net.HDG.UB(String Q, Boolean T, HFG B)
   at Rebex.Net.Sftp.PKT(String Q, HFG T)
   at Rebex.Net.Sftp.ZN(String Q, HFG T)

1 Answer

0 votes
by (148k points)
Rebex SFTP 2017 R2 has never been tested on .NET 6 (released more than 4 years later), and is not supposed to work on it. If it does work (even partially), it is no more than a lucky coincidence, and we strongly advice against using that combination in production environment.

Please try performing the same operation with a recent version of Rebex SFTP that supports .NET 6, and let us know if it still fails. The first version of Rebex SFTP with .NET 6 support is 6.0.8000, published in November 2021: https://www.rebex.net/sftp.net/history.aspx#R6.0
by (120 points)
Thanks Lukas for your message. Just small correction our SFTP library is .net standard 2.0 that performs all SFTP operation.
by (148k points)
.NET Standard is not a framework or a platform. It's an API specification. The runtime is what's important. If you are using a 7-year-old Rebex library intended and tested for .NET Framework 4.0-4.6, but running it on 2-year-old .NET 6, then it's not a supported configuration and we would not expect it to work properly. Those old "net-4.0" binaries were only supported on .NET Framework 4.0-4.6.x and on Mono. Additionally, Rebex SFTP 2017 R2 is outdated, contains known bugs, and is no longer supported.
Please try using the R5.13, which features an API that is almost the same as 2017 R2 (check out https://www.rebex.net/sftp.net/history.aspx#2019R1 for differences), is still up-to-date, and comes with binaries targeting .NET Standard 2.0. Download link to a trial version: https://www.rebex.net/getfile/999325b160e14869927ec8478ab48c73/RebexTotalPack-R5.13-Trial.zip
...