Sftp_GetAttributes method - WeOnlyDo Discussion board

Sftp_GetAttributes method (wodSFTP / wodSFTP.NET / wodSFTPdll)

by Mariana, Thursday, January 10, 2019, 11:05 (132 days ago)

Hello,

I'm trying to connect an old version of an Windows 7 application, as client, with an HP UNIX server, in order to transfer files/archives from client to server, using SFTP transfer.
The SSH version from HP UX server is:
$ ssh -V
OpenSSH_7.4p1+sftpfilecontrol-v1.3-hpn14v12, OpenSSL 1.0.2k 26 Jan 2017
HP-UX Secure Shell-A.07.40.003, HP-UX Secure Shell version
$
The client application use SftpDLL64.dll, version 3.6.2.145 from 14.03.2013.
There is an error in Event Viewer, on client:
SFTP File '/raptor/SBUP/SLP/SLSM6Y.2019.01.08.09.57.09.VODU_01.SLPBUT.ZIP' Already Exists on Server. Cannot create file when it already exists.
It seems the problem comes from the method: Sftp_GetAttributes. Maybe I'm wrong.
In addition, the transfer works fine using the same client application, but with an old version of HP UNIX server.

BR,
Mariana

Sftp_GetAttributes method

by Mariana, Thursday, January 10, 2019, 11:28 (132 days ago) @ Mariana

Hello,

I'm trying to connect an old version of an Windows 7 application, as client, with an HP UNIX server, in order to transfer files/archives from client to server, using SFTP transfer.
The SSH version from HP UX server is:
$ ssh -V
OpenSSH_7.4p1+sftpfilecontrol-v1.3-hpn14v12, OpenSSL 1.0.2k 26 Jan 2017
HP-UX Secure Shell-A.07.40.003, HP-UX Secure Shell version
$
The client application use SftpDLL64.dll, version 3.6.2.145 from 14.03.2013.
There is an error in Event Viewer, on client:
SFTP File '/raptor/SBUP/SLP/SLSM6Y.2019.01.08.09.57.09.VODU_01.SLPBUT.ZIP' Already Exists on Server. Cannot create file when it already exists.
It seems the problem comes from the method: Sftp_GetAttributes. Maybe I'm wrong.
In addition, the transfer works fine using the same client application, but with an old version of HP UNIX server.

BR,
Mariana

I also mention that the files are successfully transferred to destination (on HP UX server), but in the client application they appear not transferred (see Event Viewer error).

Sftp_GetAttributes method

by wodSupport, Thursday, January 10, 2019, 14:52 (132 days ago) @ Mariana

Hi Mariana,

can you give us more details on what you are actually doing? How is GetAttributes related to upload?

Can you please try with the latest version, since version from 2013 is really old, and this issue, if there is one, could be possibly fixed in newer ones.

Kind regards,
Jasmine.

Sftp_GetAttributes method

by Mariana, Friday, January 11, 2019, 12:28 (131 days ago) @ wodSupport

Hi,

In fact, the application goes well (using SftpDLL64.dll already indicated), if it transfers to a destination with an older HP UX server.
If there is a connection with a newer HP UX server version (mentioned above), on client it appears that nothing has been transferred, but, in fact, on destination, everything is successfully transferred.
In this case, the Sftp_GetAttributes method returns 0, as it already finds the transferred archives on the server.

bool SFTPConnection::SFTPFileFind(LPCTSTR RemoteFile)
{
long lfileExist = Sftp_GetAttributes(handle, (char *) RemoteFile, 0);
if(lfileExist == 0)
{
TCHAR Temp[100];
wsprintf(Temp,"%s",RemoteFile) ;
LOG_E_WIN32_EVENT0(RERR_RAPTOR_FILEDISTRIBUTOR_SFTP_FILE_ALREADY_EXISTS,Temp);
return true;
}
}
The problem appears as a desynchronization between client and server. The client does not know that the transfer is already done on the server.

BR,
Mariana

Sftp_GetAttributes method

by Jasmine, Friday, January 11, 2019, 12:40 (131 days ago) @ Mariana

Hi Mariana,

but I still don't know what you're doing. Do you upload files? Or use GetAttributes? How are those related? I'm sure component cannot be "out of sync", it does return some error at some point which you maybe ignore.

Please update to latest version to see if problem persists.

Jasmine.