Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
12.9k views
in General by (400 points)
I am experiencing network timeouts that are interrupting the connection to the sFTP server.

My scenario is this:
I created a c# server interface that is registered with RegAsm and is accessed by the client application with CreateObject().
Once the client application has instantiated the sever, if anything happens to the connection that is formed the client locks up in memory.
Is there a timeout property for inactivity built into edtFTPPro.net that I haven't set correctly? Or am I not using threading appropriately, or is there another way that i can test for inactivity that I might be able to close the client and get a restart? Any information will be greatly appreciated.

Thanks
Alan

Log entry from remote FTP server:
000002488368 2011-04-19 08:32:44.531 6984 CORP2\NANTOS:[Info][30093] .\sshd.cpp:LoginProc(11683) The client was disconnected by intermediate network components or chose to disconnect without sending a disconnect message.

Log from edtFTPPro.net:
DEBUG [LicenseProperties] 19 Apr 2011 08:36:49.344 : Looking for subkey Software\Enterprise Distributed Technologies\edtFTPnet PRO (fallback )
DEBUG [LicenseProperties] 19 Apr 2011 08:36:49.344 : Found license subkey Software\Enterprise Distributed Technologies\edtFTPnet PRO
DEBUG [LicenseProperties] 19 Apr 2011 08:36:49.344 : Did not find license subkeys Software\Enterprise Distributed Technologies\edtFTPnet PRO or in registry
DEBUG [LicenseProperties] 19 Apr 2011 08:36:49.359 : Looking for subkey Software\Enterprise Distributed Technologies\edtFTPnet PRO (fallback )
DEBUG [LicenseProperties] 19 Apr 2011 08:36:49.359 : Found license subkey Software\Enterprise Distributed Technologies\edtFTPnet PRO
DEBUG [LicenseProperties] 19 Apr 2011 08:36:49.359 : Did not find license subkeys Software\Enterprise Distributed Technologies\edtFTPnet PRO or in registry
DEBUG [LicenseProperties] 19 Apr 2011 08:36:49.359 : Looking for subkey Software\Enterprise Distributed Technologies\edtFTPnet PRO (fallback )
DEBUG [LicenseProperties] 19 Apr 2011 08:36:49.359 : Found license subkey Software\Enterprise Distributed Technologies\edtFTPnet PRO
DEBUG [LicenseProperties] 19 Apr 2011 08:36:49.359 : Did not find license subkeys Software\Enterprise Distributed Technologies\edtFTPnet PRO or in registry
DEBUG [LicenseProperties] 19 Apr 2011 08:36:49.359 : Looking for subkey Software\Enterprise Distributed Technologies\edtFTPnet PRO (fallback )
DEBUG [LicenseProperties] 19 Apr 2011 08:36:49.359 : Found license subkey Software\Enterprise Distributed Technologies\edtFTPnet PRO
DEBUG [LicenseProperties] 19 Apr 2011 08:36:49.359 : Did not find license subkeys Software\Enterprise Distributed Technologies\edtFTPnet PRO or in registry
DEBUG [FTPConnection] 19 Apr 2011 08:36:49.375 : Set LocalDirectory='e:\data\combineddrsb'
DEBUG [SecureFTPConnection] 19 Apr 2011 08:36:49.375 : Set LocalDirectory to e:\data\combineddrsb
DEBUG [HostNameResolver] 19 Apr 2011 08:36:49.484 : Resolving corp2.dfas.mil
DEBUG [HostNameResolver] 19 Apr 2011 08:36:49.516 : Obtained 1 addresses
DEBUG [HostNameResolver] 19 Apr 2011 08:36:49.516 : IP address: 207.133.66.100
DEBUG [HostNameResolver] 19 Apr 2011 08:36:49.516 : corp2.dfas.mil resolved to 207.133.66.100
DEBUG [SSHFTPClient] 19 Apr 2011 08:36:49.516 : Connecting directly to SFTP server 207.133.66.100:22
DEBUG [SSHFTPClient] 19 Apr 2011 08:36:49.531 : Connected successfully to SFTP server 207.133.66.100:22
DEBUG [SSHConnection] 19 Apr 2011 08:36:49.531 : Beginning protocol negotiation
DEBUG [PlainSocket] 19 Apr 2011 08:36:49.625 : RepeatCallback received 48 bytes
DEBUG [ProtocolNegotiationHandler] 19 Apr 2011 08:36:49.625 : offset=0,length=48
DEBUG [ProtocolNegotiationHandler] 19 Apr 2011 08:36:49.625 : Read: 'SSH-2.0-WRQReflectionforSecureIT_7.2 Build 151'
DEBUG [SSHUtil] 19 Apr 2011 08:36:49.625 : Major string = '2'
DEBUG [SSHUtil] 19 Apr 2011 08:36:49.625 : Minor string = '0'
DEBUG [SSHUtil] 19 Apr 2011 08:36:49.625 : Version 2.0
DEBUG [SSHUtil] 19 Apr 2011 08:36:49.625 : Protocol compatible
DEBUG [SSHConnection] 19 Apr 2011 08:36:49.625 : Server version=SSH-2.0-WRQReflectionforSecureIT_7.2 Build 151
DEBUG [SSH2Connection] 19 Apr 2011 08:36:49.625 : Timeout=120000
DEBUG [SSHConnection] 19 Apr 2011 08:36:49.625 : Sending client version=SSH-2.0-edtFTPnet/PRO-7.1.0.20
DEBUG [SSH2Connection] 19 Apr 2011 08:36:49.625 : Starting key exchange
DEBUG [PlainSocket] 19 Apr 2011 08:36:49.625 : RepeatCallback received 256 bytes
DEBUG [AbstractKeyExchanger] 19 Apr 2011 08:36:49.625 : Sending SSH_MSG_KEXINIT
DEBUG [PlainSocket] 19 Apr 2011 08:36:49.625 : RepeatCallback received 96 bytes
DEBUG [AbstractKeyExchanger] 19 Apr 2011 08:36:49.625 : key exchange method=diffie-hellman-group1-sha1
DEBUG [AbstractKeyExchanger] 19 Apr 2011 08:36:49.641 : hostkey algorithms=ssh-dss,ssh-rsa
DEBUG [AbstractKeyExchanger] 19 Apr 2011 08:36:49.641 : ciphers=aes256-cbc
DEBUG [AbstractKeyExchanger] 19 Apr 2011 08:36:49.641 : ciphers=aes256-cbc
DEBUG [AbstractKeyExchanger] 19 Apr 2011 08:36:49.641 : MACs=hmac-sha1
DEBUG [AbstractKeyExchanger] 19 Apr 2011 08:36:49.641 : MACs=hmac-sha1
DEBUG [AbstractKeyExchanger] 19 Apr 2011 08:36:49.641 : compression algorithms=none
DEBUG [AbstractKeyExchanger] 19 Apr 2011 08:36:49.641 : compression algorithms=none
DEBUG [AbstractKeyExchanger] 19 Apr 2011 08:36:49.641 : Sent SSH_MSG_KEXINIT
DEBUG [ClientKeyExchanger] 19 Apr 2011 08:36:49.641 : Reading SSH_MSG_KEXINIT reply
DEBUG [AbstractKeyExchanger] 19 Apr 2011 08:36:49.641 : Processing SSH_MSG_KEXINIT reply
DEBUG [AbstractKeyExchanger] 19 Apr 2011 08:36:49.641 : Remote kex alg=diffie-hellman-group1-sha1,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1
DEBUG [AbstractKeyExchanger] 19 Apr 2011 08:36:49.641 : Decided kex alg= DiffieHellmanGroup1Sha1
DEBUG [AbstractKeyExchanger] 19 Apr 2011 08:36:49.641 : Remote hostkey alg=ssh-dss
DEBUG [AbstractKeyExchanger] 19 Apr 2011 08:36:49.641 : Decided hostkey alg= DSA
DEBUG [ClientKeyExchanger] 19 Apr 2011 08:36:49.641 : Remote Cipher CS=aes128-ctr,aes192-ctr,aes256-ctr,aes128-cbc,aes192-cbc,aes256-cbc,3des-cbc
DEBUG [ClientKeyExchanger] 19 Apr 2011 08:36:49.641 : Decided Cipher C->S= AES256
DEBUG [ClientKeyExchanger] 19 Apr 2011 08:36:49.641 : Remote Cipher SC=aes128-ctr,aes192-ctr,aes256-ctr,aes128-cbc,aes192-cbc,aes256-cbc,3des-cbc
DEBUG [ClientKeyExchanger] 19 Apr 2011 08:36:49.641 : Decided Cipher S->C= AES256
DEBUG [ClientKeyExchanger] 19 Apr 2011 08:36:49.641 : Remote MAC CS=hmac-sha1
DEBUG [ClientKeyExchanger] 19 Apr 2011 08:36:49.641 : Decided MAC C->S= HMACSHA1
DEBUG [ClientKeyExchanger] 19 Apr 2011 08:36:49.641 : Remote MAC SC=hmac-sha1
DEBUG [ClientKeyExchanger] 19 Apr 2011 08:36:49.641 : Decided MAC S->C= HMACSHA1
DEBUG [ClientKeyExchanger] 19 Apr 2011 08:36:49.641 : Remote Comp CS=zlib,none
DEBUG [ClientKeyExchanger] 19 Apr 2011 08:36:49.641 : Decided Comp C->S=None
DEBUG [ClientKeyExchanger] 19 Apr 2011 08:36:49.641 : Remote Comp SC=zlib,none
DEBUG [ClientKeyExchanger] 19 Apr 2011 08:36:49.641 : Decided Comp S->C=None
DEBUG [ClientKeyExchanger] 19 Apr 2011 08:36:49.641 : first_kex_packet_follows=False
DEBUG [AbstractKeyExchanger] 19 Apr 2011 08:36:49.641 : Processed SSH_MSG_KEXINIT reply
DEBUG [ClientKeyExchanger] 19 Apr 2011 08:36:49.641 : Sending SSH_MSG_KEXDH_INIT
DEBUG [AbstractKeyExchanger] 19 Apr 2011 08:36:49.656 : DH_PRIME_GROUP1
DEBUG [ClientKeyExchanger] 19 Apr 2011 08:36:49.672 : Sent SSH_MSG_KEXDH_INIT
DEBUG [ClientKeyExchanger] 19 Apr 2011 08:36:49.672 : Reading

8 Answers

0 votes
by (161k points)
Please enable logging at the Debug level and post a relevant log snippet. We will probably move this thread into the edtFTPnet/PRO forum.
0 votes
by (400 points)
Bruce -
Did you find any particular info on this topic?
0 votes
by (400 points)
Bruce - any new light on this subject
0 votes
by (161k points)
The error in your log is an authentication failure. So you are providing an invalid private key for the user, or the user's public key is not registered on the server.
0 votes
by (400 points)
Yes, I understand the problem but, when this occurs sFTP stays connected to the server Reflections session and does not return control to the client application. This, in effect, simulates a lock up instead of recording the error and returning control to the client application thru DCOM. I built a C# component that negotiates the communication between the client foxpro application and EDT server application. I cannot figure out the property I need to use to get EDT to relase control back to my client application facilitating a failure to connect error. I was inquiring which property to use to get EDT to release its memory segment so that the foxpro client can continue its processing.
0 votes
by (51.1k points)
Can you please post your code? If you are handling any event from our components, please post those as well.

- Hans (EnterpriseDT)
0 votes
by (400 points)
using System;
using System.Runtime.InteropServices;

namespace EnterpriseDT
{
    //[ClassInterface(sftp.AutoDual)]
    //[ProgId("EnterpriseDT.SecureFTPConnection")]
    [Guid("75C37F9E-A0E7-4004-8E56-95C00AD29843")]
    //[ComVisible(true)]
    public interface SFTPTransfer_Interface
    {
        [DispId(1)]
        void upLoadFile(string targetAddress, string targetFilePath, string sourceFilePath, string result);
        [DispId(2)]
        string[] GetFiles();
        [DispId(3)]
        void Connect();
        [DispId(4)]
        void Close();
        [DispId(5)]
        string ServerAddress{ get; set; }
        [DispId(6)]
        string UserName{ get; set; }
        [DispId(7)]
        string Password { set; }
        [DispId(8)]
        bool IsConnected { get; }
        [DispId(9)]
        int portUsed { get; set;  }
        [DispId(10)]
        void InitializeComponent(string PrivateKeyLocationAndFileName, string PrivateKeyPassphrase, string sLogFileName);
        [DispId(11)]
        void addknownHostFile(string HostName, string publicKeyLocation);
        [DispId(12)]
        void deleteFileFromServer(string targetFilepath, string strfilename);
    }
    [Guid("6AC80E65-5BC9-4443-B64B-95F5FC193744"),
    ClassInterface(ClassInterfaceType.None)]
    public class SecureFTPConnection : SFTPTransfer_Interface
        {
            public SecureFTPConnection()
            {
//                EnterpriseDT.Net.Ftp.SecureFTPConnection.LogLevel = EnterpriseDT.Util.Debug.LogLevel.All;
//                EnterpriseDT.Net.Ftp.SecureFTPConnection.LogFile = @"Logs\ftplogfile.log";
            }
            private EnterpriseDT.Net.Ftp.SecureFTPConnection cxn;
//                cxn = new EnterpriseDT.Net.Ftp.SecureFTPConnection();
           

            public string ServerAddress
            {
                get { return cxn.ServerAddress; }
                set { cxn.ServerAddress = value; }
            }

            public string UserName
            {
                get { return cxn.UserName; }
                set { cxn.UserName = value; }
            }

            public void addknownHostFile(string HostName, string publicKeyLocation)
            {
                cxn.KnownHosts.AddKnownHost(HostName, publicKeyLocation);
            }

             public int portUsed
            {
                get { return cxn.ServerPort; }
                set { cxn.ServerPort = value; }
            }

            public bool IsConnected
            {
                get { return cxn.IsConnected ; }
            }

            public string Password
            {
                get { return cxn.Password; }
                set { cxn.Password = value; }
            }

            public void Connect()
            {
                cxn.Connect();
            }

            public string[] GetFiles()
            {
                return cxn.GetFiles();
            }

            public void Close()
            {
                cxn.Close();
                cxn = null;
                EnterpriseDT.Net.Ftp.SecureFTPConnection.LogLevel = EnterpriseDT.Util.Debug.LogLevel.Off;
                EnterpriseDT.Net.Ftp.SecureFTPConnection.LogFile = null;
            }

           public void deleteFileFromServer(string targetFilepath, string strfilename)
           {
               if (cxn.DirectoryExists(targetFilepath))
               {
                   cxn.ChangeWorkingDirectory(targetFilepath);
                   if (cxn.Exists(strfilename))
                   {
                      cxn.DeleteFile(strfilename);
                   }
               }
           }

            private void setupParms(string sLogFileName)
            {
                EnterpriseDT.Net.Ftp.SecureFTPConnection.LogLevel = EnterpriseDT.Util.Debug.LogLevel.All;
                EnterpriseDT.Net.Ftp.SecureFTPConnection.LogFile = sLogFileName;
            }

            public void upLoadFile(string targetFile, string targetFilePath, string sourceFilePath, string results)
            {
                /*if (cxn.DirectoryExists
0 votes
by (51.1k points)
Hi Alan

I suggest logging messages before and after you call our connect method, i.e.
public void Connect() 
{ 
    try
    {
        log.Debug("Connecting");
        cxn.Connect(); 
        log.Debug("Connected");
    }
    catch (Exception e)
    {
        log.Error("Connection error", e);
        throw;
    }
}

where log is defined as
Logger log = EnterpriseDT.Util.Debug.Logger.GetLogger("COMSecureFTPConnection");


This is to confirm that it never exits the SecureFTPConnection.Connect() method.

- Hans (EnterpriseDT)

Categories

...