This project has moved. For the latest updates, please go here.

Messages for the SFTP Send Adapter remains active when trying to send to ProFTPD server

Oct 10, 2012 at 8:35 PM
Edited Oct 10, 2012 at 8:40 PM

Hi,

I have an issue when sending messages to a ProFTD server using the SFTP adapter. The messages get stuck in BizTalk in an active state and nothing happens for a while. Nothing shows up in the eventlog and no other errors can be found. I don't have access to the remote ProFTD server so I can't check logs there. I have verified that I can transmit files from the BizTalk server using a Bitvise SSH Client with the same username and password.

The trace log looks like this:

Adapter.Adapter name: Sftp Transmit Adapter
Adapter.Load
Adapter.Initialize
[AsyncTransmitter] Enter
[SftpTransmitterEndpoint] Created...
[SftpTransmitProperties] ReadLocationConfiguration called
[SftpTransmitProperties] Username/Password Authentication
[SftpConnectionPool] Started...
[SftpConnectionPool] GetConnectionFromPool creating a new connection for pool
[SftpTransmitterEndpoint] Sftp.Put /OrderTest.xml
[SftpConnectionPool] Connecting to <host name>
[TimeSchedule]Executing GetNextActivationTime
[TimeSchedule]Executing GetNextActivationTime
[TimeSchedule]Executing GetNextActivationTime
[TimeSchedule]Executing GetNextActivationTime
[TimeSchedule]Executing GetNextActivationTime
[TimeSchedule]Executing GetNextActivationTime
[TimeSchedule]Executing GetNextActivationTime
[TimeSchedule]Executing GetNextActivationTime
[TimeSchedule]Executing GetNextActivationTime
[TimeSchedule]Executing GetNextActivationTime
[TimeSchedule]Executing GetNextActivationTime
[TimeSchedule]Executing GetNextActivationTime
[TimeSchedule]Executing GetNextActivationTime

After a while I get the following errors in the eventlog:

Method: Blogical.Shared.Adapters.Sftp.SharpSsh.Sftp.connect
Error: Unable to connect to Sftp host [<host name>]

------------------------------
Information:
Type: System.Exception
Target:
Message: Unable to connect to Sftp host [<host name>]
Stacktrace:


------------------------------
Type: System.Exception
Target: Void CheckConnected()
Message: SSH session is not connected.
Stacktrace:
   at Tamir.SharpSsh.SshBase.CheckConnected()
   at Blogical.Shared.Adapters.Sftp.SharpSsh.Sftp.CheckHostKey()
   at Blogical.Shared.Adapters.Sftp.SharpSsh.Sftp.connect(Boolean force)

Method: Blogical.Shared.Adapters.Sftp.SharpSsh.Sftp.Put
Error: Unable write file to /OrderTest.xml

------------------------------
Information:
Type: Blogical.Shared.Adapters.Sftp.SftpException
Target:
Message: Unable write file to /OrderTest.xml
Stacktrace:


------------------------------
Type: System.Exception
Target: Void connect(Boolean)
Message: Unable to connect to Sftp host [<host name>]
Stacktrace:
   at Blogical.Shared.Adapters.Sftp.SharpSsh.Sftp.connect(Boolean force)
   at Blogical.Shared.Adapters.Sftp.SharpSsh.Sftp.Put(Stream memStream, String destination)


------------------------------
Type: System.Exception
Target: Void CheckConnected()
Message: SSH session is not connected.
Stacktrace:
   at Tamir.SharpSsh.SshBase.CheckConnected()
   at Blogical.Shared.Adapters.Sftp.SharpSsh.Sftp.CheckHostKey()
   at Blogical.Shared.Adapters.Sftp.SharpSsh.Sftp.connect(Boolean force)

 

Message: [SftpTransmitterEndpoint] Unable to transmit file /OrderTest.xml.
Inner Exception:
Unable write file to /OrderTest.xml
Unable to connect to Sftp host [<host name>]. Changing any Send Port Transport properties might require the host to be restarted, as the connection pool might still have connections
Stacktrace:
   at Blogical.Shared.Adapters.Sftp.SftpTransmitterEndpoint.ProcessMessageInternal(IBaseMessage message, ISftp sftp)
   at Blogical.Shared.Adapters.Sftp.SftpTransmitterEndpoint.ProcessMessage(IBaseMessage message)

------------------------------
Type: Blogical.Shared.Adapters.Sftp.SftpException
Target: Void Put(System.IO.Stream, System.String)
Message: Unable write file to /OrderTest.xml
Stacktrace:
   at Blogical.Shared.Adapters.Sftp.SharpSsh.Sftp.Put(Stream memStream, String destination)
   at Blogical.Shared.Adapters.Sftp.SftpTransmitterEndpoint.ProcessMessageInternal(IBaseMessage message, ISftp sftp)


------------------------------
Type: System.Exception
Target: Void connect(Boolean)
Message: Unable to connect to Sftp host [<host name>]
Stacktrace:
   at Blogical.Shared.Adapters.Sftp.SharpSsh.Sftp.connect(Boolean force)
   at Blogical.Shared.Adapters.Sftp.SharpSsh.Sftp.Put(Stream memStream, String destination)


------------------------------
Type: System.Exception
Target: Void CheckConnected()
Message: SSH session is not connected.
Stacktrace:
   at Tamir.SharpSsh.SshBase.CheckConnected()
   at Blogical.Shared.Adapters.Sftp.SharpSsh.Sftp.CheckHostKey()
   at Blogical.Shared.Adapters.Sftp.SharpSsh.Sftp.connect(Boolean force)

I have tested to send the same message to another SFTP server (WinSSH), with the same configuration except for the host name and remote file path and then everything works fine.

I'm using BizTalk Server 2010 and the 1.4.0 version of the SFTP adapter. The send handler runs in a 64 bit host. I read a similar post (http://sftpadapter.codeplex.com/discussions/216810) and there the issue seemed to have to do with the send adapter connection pool. It was suggested that the connection pool should be set to 0. I tried this by setting the "SSH Connection Limit" to 0 and I also tried to set 

<configSections>
       <section name="Blogical.Shared.Adapters.Sftp"
           type="Blogical.Shared.Adapters.Common.XmlSerializerSectionHandler, Blogical.Shared.Adapters.Common, Version=1.0.2.0, Culture=neutral, PublicKeyToken=d2417434632efeea" />
    </configSections>
   
    <Blogical.Shared.Adapters.Sftp>
    <SftpConnectionPool defaultConnectionLimit="60">
        <Host hostName="<hostname>" connectionLimit="0"/>
        </SftpConnectionPool>
    </Blogical.Shared.Adapters.Sftp>

but no success.

Since it is working when I send to other SFTP servers I'm thinking I maybe need to use some special configuration when sending to ProFTPD. Does anyone have any input on this?

I would be greatful for any advice concerning this!

Thanks,

Kim

Oct 11, 2012 at 11:02 AM

Ok, it seems like the adapter can't handle the host key file returned by the ProFTPD server. Or at least it can't store the host key. When I check the SftpHostFiles.config file, I can see entries for the other SFTP servers I have sent files to but nothing for the ProFTPD server. Anyone seen something similar?

Aug 21, 2013 at 9:55 AM
Hi,

Has anyone find the solution to this problem ?

Thanks
Coordinator
Nov 25, 2013 at 8:25 AM
Hi,

Please see release v1.5.0 which resolves various send/receive stability issues.