BizTalk SFTP adapter: “Unable write file”

Since recently my SFTP send port for some reason couldn’t write any files to the configured SFTP folder anymore. The error information displayed on the suspended instances was:

An unexpected failure occurred while processing a message. The text associated with the exception is “[SftpTransmitterEndpoint] Unable to transmit file sftpfolder/51D8D887-DB21-4675-8EA2-927B86F84CF3.
Inner Exception:
Unable write file to sftpfolder/51D8D887-DB21-4675-8EA2-927B86F84CF3
Unable to connect to Sftp host [sftpHost]. Changing any Send Port Transport properties might require the host to be restarted, as the connection pool might still have connections”.

In the event viewer there were a bunch of error events logged coming from the SFTP adapter.

EventVwr

The events stated some different error messages like:

Method: Blogical.Shared.Adapters.Sftp.SharpSsh.Sftp.CheckHostKey
Error: HostKey does not match previously retrieved HostKey.

Method: Blogical.Shared.Adapters.Sftp.SharpSsh.Sftp.connect
Error: Unable to connect to Sftp host [mpm01.uat.vvm.addelijn.be]

Method: Blogical.Shared.Adapters.Sftp.SharpSsh.Sftp.Put
Error: Unable write file to sftpfolder/62EFCE4A-8BFE-428B-B4E4-4B43A9B35075

Method: Blogical.Shared.Adapters.Sftp.SftpTransmitterEndpoint.ProcessMessage
Error: [SftpTransmitterEndpoint] Unable to transmit file sftpfolder/62EFCE4A-8BFE-428B-B4E4-4B43A9B35075.
Inner Exception:
Unable write file to sftfolder/62EFCE4A-8BFE-428B-B4E4-4B43A9B35075
Unable to connect to Sftp host [sftpHost]. Changing any Send Port Transport properties might require the host to be restarted, as the connection pool might still have connections

A message sent to adapter “SFTP” on send port “SP_Employee.Messaging_Whitelist” with URI “SFTP://sftpHost:22/sftpfolder/%SourceFileName%” is suspended.
Error details: An unexpected failure occurred while processing a message. The text associated with the exception is “[SftpTransmitterEndpoint] Unable to transmit file sftpfolder/62EFCE4A-8BFE-428B-B4E4-4B43A9B35075.
Inner Exception:
Unable write file to sftpfolder/62EFCE4A-8BFE-428B-B4E4-4B43A9B35075
Unable to connect to Sftp host [sftpHost]. Changing any Send Port Transport properties might require the host to be restarted, as the connection pool might still have connections”.
MessageId: {E5D8FDDE-7246-484C-82B2-335B171BB8F0}
InstanceID: {D3E33013-9250-4750-9B4B-68926601D7FD}

How to solve the issue?

It was the info ‘HostKey does not match previously retrieved HostKey’ that got me thinking. And finally also provided me with the solution.
To overcome this issue, I located the hostkey that was saved and simply removed the hostkey.

Follow these steps to solve this issue

  1. locate the SftpHostFiles.config file. It can be found under something like ‘C:\Users\[BTSUser]\AppData\Local\IsolatedStorage\abwnobui.3i0\ipehwsgb.i2y\Url.hxlzol3fqigkmb3hbeb4siqcmd5vjau2\AssemFiles’
  2. Edit the config file and remove the node containing the  SFTP Host that you are trying to connect to, and save the config file.
  3. Restart the host instance

This should suffice to have a working solution again.

Hope this will help you out.

Advertisements

3 comments on “BizTalk SFTP adapter: “Unable write file”

  1. vdha says:

    Any idea why this happens. And do we have to remove both and from the config file?

    • mitchke says:

      Could be caused by a failover in the FTP cluster for example. There is no longer a trust from the client to the server for some reason.

      Removing the sector in the config file for this host key should suffice.

      • Venky says:

        I am having the same issue. The first transmission after removing the node is successful. Then the second transmission has the same issue. I see the node being created again. What is the resolution for this?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s