EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Error 10054

Posted: 02/02/2015 11:30:14
by Aamir Attia (Standard support level)
Joined: 02/02/2015
Posts: 2

To start off, Ive searched the forum and couldnt find any advice that rectified my issue.

We are using version 12 of SBB for sftp connections in a nightly batch job and the program will randomly error out during the week. In one of the forum topics, we saw to turn off compression and tried that as well with no luck. Below is a code snippet of what were doing
            SBSimpleSftp.TElSimpleSFTPClient sftpClient = new SBSimpleSftp.TElSimpleSFTPClient();
            sftpClient.Address = configuration.Host;
            sftpClient.Username = configuration.Username;
            sftpClient.Password = configuration.Password;
            sftpClient.Port = Convert.ToInt32(configuration.Port);
            sftpClient.ASCIIMode = true;

            //for (short i = 0; i <= 3; i++)
            //sftpClient.set_CompressionAlgorithms(i, false);  //test turning it all off!


            int timeout = 1200000;
            sftpClient.CommandTimeout = timeout;
            sftpClient.SocketTimeout = timeout;
            sftpClient.UseInternalSocket = true;

            sftpClient.OnKeyValidate += new SBSSHCommon.TSSHKeyValidateEvent(sftpClient_OnKeyValidate);

                string uploadUri = String.Empty;
                foreach (string fileDetail in fileDetails) //list of files were sftp'ing
                        uploadUri = CreateURI(ftpConfiguration, Path.GetFileName(fileDetail));
                        sftpClient.UploadFile(fileDetail, uploadUri, SBTypes.TSBFileTransferMode.ftmOverwrite);
                    catch (Exception exception)
                        string errorStatus = "Exception: " + exception.Message + ", StackTrace: " + exception.StackTrace;
            catch (SBSftpCommon.EElSFTPError sftpError)
                string exceptionMessage = "SBB Connection Open Failed. " + sftpError.Message;
                throw new Exception(exceptionMessage, sftpError);
            catch (Exception exception)
                string exceptionMessage = "SBB Connection Open Failed. " + exception.Message;
                throw new Exception(exceptionMessage, exception);
            return uploadStatus;


Exception: Connection lost (error code is 10054), StackTrace:
at SBSimpleSftp.TElSimpleSFTPClient.DoSend(Object Sender, Byte[] Buffer)
at SBSSHCommon.TElSSHClass.DoSend(Byte[] Buffer, Int32 Size)
at SBSSHClient.TElSSHClient.SSH2SendOnTransportLayer(Int32 Size)
at SBSSHClient.TElSSHClient.SSH2SendTunnelData(UInt32 RemoteChannel, Byte[] Buffer, Int32 Offset, Int32 Size)
at SBSSHClient.TElSSHClient.SendTunnelData(UInt32 RemoteChannel, Byte[] Buffer, Int32 Offset, Int32 Size)
at SBSSHClient.TElSSHClientTunnelConnection.SendData(Byte[] Buffer, Int32 Offset, Int32 Size)
at SBSftp.TElSftpClient.SendOnTransportLayer(Int32 Size, Byte PacketType)
at SBSftp.TElSftpClient.SendClose(Byte[] Handle)
at SBSftp.TElSftpClient.CloseHandle(Byte[] Handle)
at SBSftp.TElSftpClient.CloseHandleSync(Byte[] Handle)
at SBSimpleSftp.TElSimpleSFTPClient.CloseHandle(Byte[] Handle)
at SBSimpleSftp.TElSimpleSFTPClient.UploadStream(Stream LocalStream, String RemoteFileName, TSBFileTransferMode Mode, Int64 RestartFrom)
at SBSimpleSftp.TElSimpleSFTPClient.UploadFile(String LocalFileName, String RemoteFileName, TSBFileTransferMode Mode, Int64 RestartFrom)
at SBSimpleSftp.TElSimpleSFTPClient.UploadFile(String LocalFileName, String RemoteFileName, TSBFileTransferMode Mode)

Let me know if more information is needed.. again, this is sporadic and not happening everytime.

Posted: 02/02/2015 13:25:17
by Eugene Mayevski (Team)

Thank you for the report.

As I can guess from the call stack, the file is uploaded correctly even in case of the reported error. If it is, then the best option is to wrap the call to UploadFile() with try/catch (you would need to do this anyway) and reconnect in case of any failure.

Unfortunately the intermittent nature of the problem doesn't explain what could go wrong, and the error is a network error, which can indicate a network failure, firewall/NAT failure or remote server decision to forcefully close connection for whatever reason. So we can't find the solution remotely.

You also need to review the server log right after the error to check if it writes down anything related to this upload operation.

On a side note please use CODE button to mark the beginning and the end of the code block in your messages. I've edited your post for you manually now.

Sincerely yours
Eugene Mayevski
Posted: 02/03/2015 12:06:17
by Aamir Attia (Standard support level)
Joined: 02/02/2015
Posts: 2

To give you some more color on the issue. We have n versions of our FTP executable all scheduled to run at the same time. Each version is client specific and connects to the same ftp server, just a different folder. When this fails, historically it has only been for one instance of the exe and not the others running, so that leads me to believe its not network related. After failure, we kick off the exe again and it fails almost immediately for the same reason. At the same time, we were successfully able to connect via CoreFTP and upload our files (albiet were running coreftp from our local machine and not the server hosting the exe). Also, I dont know if it helps, but when the error occurs, the file is partially written and the connection is closed during write.

As for a log file from the server, I do have one but dont want to post it on the forum, please let me know where I can send it.

Also, should we be setting a timeout or leave it null? And lastly our code is setting asciimode to true, should this be false (we post images and xml files)?

Posted: 02/03/2015 12:45:05
by Eugene Mayevski (Team)

Let's continue in HelpDesk ( https://www.eldos.com/helpdesk/ ) please. I have created a new support ticket based on your above message. You will see your (and only your) support tickets by following this URL. You will also get e-mail notifications about updates related to your support ticket.

Sincerely yours
Eugene Mayevski



Topic viewed 972 times

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


Back to top

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

Got it!