EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Upload of files to WS_FTP fails sometimes

Also by EldoS: MsgConnect
Cross-platform protocol-independent communication framework for building peer-to-peer and client-server applications and middleware components.
Posted: 09/08/2009 09:23:22
by Frank Munsberg (Standard support level)
Joined: 06/04/2009
Posts: 49

Again I'm encountering some strange Errors with WS_FTP 7.1 server and SBB
When I try to upload like 3000 small files (~1kb) I'm getting some errors.
The way this interacts with the SFTP Server is by opening a connection, looping through the files for uploading, calling UploadFile and then ListDirectory for verification. At the end the connection is closed again.

Error 1: "End Of File" quite often an .UploadFile or a .ListDirectory will fail with "End Of File" and Code 4
the connection stays open and the upload of the next files continues. Most of the time, this results in a 0-byte filesize on the server for the uploaded file.

Error 2: "SFTP Component not connected" Code 6 which seems to happen during a call to .ListDirectory and also to .UploadFile. This error seems to happen when there are close to 3000 files in the remote folder.
When this happens, the connection is effectively closed and all further files fail to transfer in this run.
Sometimes (not always) this seems to trigger a Protocol error in the Server log stating the following:

<![CDATA[System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
   at GetUserPerms(IFTPHost* , IFTPPermissionSet* , IFTPUser* , Char* )
   at UtilAPI.User.GetPermission(PermissionSet pPermSet, String pFileName)
   at SSHServerAPI.SFTP.Subsystem.FXP_Readdir()
   at SSHServerAPI.SFTP.Subsystem.DispathPacket()]]>

I am not sure, if this can cause the SSH Daemon of WS_FTP to crash but can't deny the possibility either. In our production environment this error also occurs sometimes and lately the Daemon has crashed several times.
Back in the days where there was no SBB accessing the server things were reportedly a bit more stable.

The Settings of the TElSimpleSFTPClient are as follows:

.AutoAdjustTransferBlock = false;
.PipelineLength = 1;

other settings are left at their default values

Increasing the PipelineLength to something high like 32 will crash the SSH daemon for sure, that was something we tested back a while ago so I've left it to 1.

Is there a way to get rid of the errors, maybe with different settings on the client?

Posted: 09/09/2009 11:15:58
by Ken Ivanov (EldoS Corp.)

System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt

Yes, the server seems to have problems with correct memory management. I have sent a message to WS_FTP developers earlier this year regarding the stability of their product, but got no response from them. Hope they will fix these things in one of the closest builds, as they are really critical.

I have re-checked the changes history and found out that WS_FTP-related workarounds have been implemented in 7.1.161. I suggest you to upgrade to the latest build (7.1.163). Once upgraded, the issues you reported should have gone. Please remember to switch AutoAdjustTransferBlock back to true after upgrading to make the component use the workarounds.



Topic viewed 2505 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!