EldoS | Feel safer!

Software components for data protection, secure storage and transfer

'End of file' error on CloseHandle

Also by EldoS: CallbackDisk
Create virtual disks backed by memory or custom location, expose disk images as disks and more.
Posted: 02/20/2015 07:22:54
by Stefan G (Standard support level)
Joined: 01/13/2015
Posts: 4


We are using SecureBlackbox 12 VCL.
We integrated your SFTP client into our software.
Generally it works fine, but we often get following
error in TElSftpClient.CloseHandle

EElSFTPError with
FLastSyncError = 1
FLastSyncComment = 'End of file'

After the error appears the first time we receive it always until
restarting the sftp client. When we debug the code, we see that
* the connection is not lost,
* the commands itself would work. (e.g. set server dir, list files)
Posted: 02/20/2015 07:27:53
by Vsevolod Ievgiienko (EldoS Corp.)

Thank you for contacting us.

If you have a license, please assign the license ticket to your user account before we continue. The ticket itself and the procedure of it's use are specified in the registration e-mail that was sent to you upon license purchase.
Posted: 02/20/2015 07:46:22
by Stefan G (Standard support level)
Joined: 01/13/2015
Posts: 4

Posted: 02/20/2015 07:56:52
by Vsevolod Ievgiienko (EldoS Corp.)

Please check the article: https://www.eldos.com/documentation/sb...error.html

SSH_ERROR_EOF if not an error - it just indicates end-of-file condition.
Posted: 09/22/2016 04:04:52
by Stefan G (Standard support level)
Joined: 01/13/2015
Posts: 4

We get the error for some SFTP Server permanently.
This is a showstopper for us!

In procedure TElSftpClient.CloseHandleSync following error is raised:

if not CloseHandle(Handle) then
raise EElSFTPError.CreateCode(FLastSyncError, FLastSyncComment);

This is the callstack:
SBSftp.TElSftpClient.CloseHandleSync((104, 120, 52, 49))
SBSimpleSftp.TElSimpleSFTPClient.CloseHandle((104, 120, 52, 49))

After the exception, the connection is not usable anymore, as the same error is raised on every command, and only a restart helps.
Posted: 09/22/2016 04:37:29
by Ken Ivanov (EldoS Corp.)

Hi Stefan,

I believe the problem might take place due to a popular bug in some SFTP servers. Please try to insert a dummy call to RequestAbsolutePath() method straight after your Open() method returns and see if it helps to overcome the issue:


// your code
// ...

Posted: 09/22/2016 07:30:20
by Stefan G (Standard support level)
Joined: 01/13/2015
Posts: 4


I tried this, but it did not help.
Posted: 09/22/2016 07:45:36
by Eugene Mayevski (EldoS Corp.)

SSH and SFTP is a running target -- the servers are updated all the time, new bugs are made, etc.. We also implement changes, needed to co-operate with those server-side changes, all the time.

So the first step to take is to try SecuerBlackbox 15 and see if it works right.

Also, please try TElSimpleSFTPClient component instead of Indy-based one.

Sincerely yours
Eugene Mayevski
Also by EldoS: CallbackFilter
A component to monitor and control disk activity, track file and directory operations (create, read, write, rename etc.), alter file data, encrypt files, create virtual files.



Topic viewed 777 times

Number of guests: 1, registered members: 0, in total hidden: 0


Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!