SFTP Client: "Unsupported file attributes data" error

Discussion of open issues, suggestions and bugs regarding network security and data protection solution - SecureBridge
Post Reply
hdokit
Posts: 4
Joined: Fri 18 Dec 2015 10:50

SFTP Client: "Unsupported file attributes data" error

Post by hdokit » Fri 18 Dec 2015 12:12

Hi,

I'm currently evaluating SecureBridge for Delphi 2007.

When using the SFTPClientDemo, the command "ScSFTPClient.ReadDirectory(Handle);" fails with the error message "Unsupported file attributes data".

Any ideas how to fix this? The server works just fine in FileZilla or CyberDuck.

Thanks in advance,
Holger

hdokit
Posts: 4
Joined: Fri 18 Dec 2015 10:50

Re: SFTP Client: "Unsupported file attributes data" error

Post by hdokit » Fri 18 Dec 2015 13:08

OK, I got one step further: I could connect to the SFTP Server by setting "ScSFTPClient.Version := vSFTP6;" before the initialization.

But now I get an error when I try to download a file: "SFTP server error occurred: Folder not found".

The folder displayed is not the path that was used for the SFTP command, but it looks like to be the local folder of the server. Like, I used "/folder/file.txt", and displayed is "\\server\directory\file.txt".

Any idea what I'm doing wrong?

TIA,
Holger

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: SFTP Client: "Unsupported file attributes data" error

Post by ViktorV » Mon 21 Dec 2015 13:55

Unfortunately, we couldn't reproduce the issue on our SFTPClient demo project. For the issue investigation, if it is possible, please give us test access to your server. Otherwise, specify the used versions of the OS and SFTP server.

cboling
Posts: 24
Joined: Fri 12 Apr 2013 01:00

Re: SFTP Client: "Unsupported file attributes data" error

Post by cboling » Fri 30 Sep 2016 18:28

hdokit wrote: "ScSFTPClient.ReadDirectory(Handle);" fails with the error message "Unsupported file attributes data".
Did you ever figure this out? I've never seen that error -- until I tried connecting to a server running WS_FTP. It gets it every time.

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: SFTP Client: "Unsupported file attributes data" error

Post by ViktorV » Mon 03 Oct 2016 09:23

It seems that your SFTP client uses an SFTP protocol version different from the one used by SFTP server. To solve the problem, try setting the TScSFTPClient.Version property value to vSFTP6 before calling the ScSFTPClient.Initialize method. Example:

Code: Select all

ScSFTPClient.Version := vSFTP6;

cboling
Posts: 24
Joined: Fri 12 Apr 2013 01:00

Re: SFTP Client: "Unsupported file attributes data" error

Post by cboling » Tue 11 Oct 2016 03:56

I've been gone for a week, and just got back and tested it.
ScSFTPClient.Version := vSFTP6;
Thanks, Viktor; that does get rid of it, making it work w/ that server.

I've always had it set at 3, based on this statement in the documentation:
If the client wants to interoperate with servers that support discontinued versions of the SFTP protocol, it should set this property to vSFTP3, and then use the OnVersionSelect event handler.
I think I need to understand how to properly use the Version property and the OnVersionSelect event.

Does "Version" represent the lowest server version I want to allow the highest, or something else?

Right now, I have only a single line in OnVersionSelect that logs a warning: "Old SFTP Server version; may not be supported yet." (I have one site that produces this warning; I don't know what they're running for a server.)
I also have code at the top of a routine where I'm calling OpenDirectory/ReadDirectory:

Code: Select all

If ord(frmRun.SFTPCli.ServerVersion) <> 3 then
    ErrSub(1,'SFTP Server version '+inttostr(ord(frmRun.SFTPCli.ServerVersion))+' may not be supported yet.');
I've never seen that msg in production; however, when I changed my version from 3 to 6 and tested against this problem server, it logged that msg, indicating a server version of 4. (When I run against one of my "normal" servers, I get no messages at all. Does this tell me that my "normal" server supports a range of versions of at least 3-6 (and is using 3 if my client is set to 3, or 6 if I set it to 6) but the problem server ONLY supports version 4?

If I basically want to support every SFTP version that SecureBridge supports (recognizing that some features aren't available in SFTPv2), what should I do?

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: SFTP Client: "Unsupported file attributes data" error

Post by ViktorV » Tue 11 Oct 2016 14:54

SFTP versions are backward-compatible, so you can set the TScSFTPClient.Version property value to vSFTP6 to support all SFTP versions.
The TScSFTPClient.OnVersionSelect event is handled when the server supports a higher version of SFTP than the one specified in the TScSFTPClient.Version property. But, typically, the server supports older SFTP versions as well. All SFTP versions supported by the server are contained in the Versions parameter, and you can set the Version parameter value to any SFTP version supported by the server.
See more details about the TScSFTPClient.OnVersionSelect event handler at h[url]ttps://www.devart.com/sbridge/docs/tscsftpclie ... select.htm[/url]

Post Reply