0 votes
by (140 points)
edited

It was running fine in with v1.5.3127. I upgraded to the latest release v 2.0.3854 and I'm now getting an error when calling SetFileDateTime. We are running WS_FTP server v6.1.0.0 .

The error I'm now getting is:

Rebex.Net.SftpException was unhandled
  Message="Unsupported operation; SSHServerAPI.SFTP.fxp_attrs."
  Source="Rebex.Net.Sftp"
  Transferred=0
  StackTrace:
       at wWGvS.APnbEo.sxMvMZ(BBdsJfZ , Type )
       at wWGvS.APnbEo.Bindhs(String , SftpAttributes )
       at Rebex.Net.Sftp.SetFileDateTime(String remotePath, DateTime newDateTime)
       at APS.Shared.Core.Implementation.SftpService.renameUploadFile(TransferFileInfo transferFileInfo) in C:\Users\pleury\Documents\Development\AustinPS\APS_Shared\src\APS.Shared\Core\Implementation\SftpService.cs:line 142
       at APS.Shared.Core.Implementation.SftpService.uploadCallback(IAsyncResult asyncResult) in C:\Users\pleury\Documents\Development\AustinPS\APS_Shared\src\APS.Shared\Core\Implementation\SftpService.cs:line 124
       at wWGvS.cLikxD.AExGBoZ()
       at wWGvS.cLikxD.PyHMxZ.AExGBoZ()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException: 

Regards,

Paul

Applies to: Rebex SFTP

2 Answers

0 votes
by (140 points)
edited

Perhaps this will help you hunt down the issue. I tested all archives and it works until I get to version 2.0.3588.0.

Paul

by (144k points)
Thanks a lot, this might have saved us some work :-)
+1 vote
by (144k points)
edited

Version 2.0.3588.0 of Rebex SFTP introduced SFTP v4 support. In this version of the SFTP protocol, the layout of SSH_FXP_ATTRS message (a binary structure defined by the protocol) changed slightly to include creation time, more precision and other fields. It looks like the error reported by the server (*Unsupported operation; SSHServerAPI.SFTP.fxp_attrs*) refers to this.

This can either be a bug in Rebex SFTP or in WS_FTP Server - we will do more testing and let you know.

In either case, it should be possible to work around this issue by instructing Rebex SFTP to use SFTP v3. This should produce a behavior identical to older versions and SetFileDateTime should work:

C#:

sftp.Options |= SftpOptions.DisableSftp4;

VB.NET:

sftp.Options = sftp.Options Or SftpOptions.DisableSftp4

(where sftp is an istance of Sftp object)

by (144k points)
Update: This was caused by a slight incompatibility of Rebex SFTP's SetFileDateTime method with WS_FTP's SFTP. It will be fixed in the next release of Rebex SFTP!
...