TLDR Update: If you get this error, then it probably is the fact that BizTalk 2013 R2 uses an older version of Putty and doesn’t support the Cipher as per this thread Open SFTP connection error and the solutions as per that are
– Upgrade to BizTalk 2016/2020
– Change SFTP server to have matching algorithms as the SFTP client
– Use external script to do the transfer from/to file location, e g scheduled task psftp.exe
– 3rd party/own SFTP adapter, e g BizTalk community based Blogical SFTP adapter
NiklasEngfelt MSFT (MSFT)
Biztalk 2013 R2 SFTP adapter only supports hmac-sha1, hmac-sha1-96 and hmac-md5 MACs and KEX algorithm
BizTalk 2013 R2 SFTP adapter MACs or KexAlgorithms
The long story as it unfolded.
I was asked to set up some interfaces connecting a on premise FTP server and to send and receive files from two SFTP servers using BizTalk 2013 R2 (CU6).
The first one used a username & password combination and worked without any issues. The other that used a username & public key however is throwing errors as below.
I can connect with FileZilla from the BizTalk server using the same username & .ppk file that are configured in BizTalk.
I’ve tried various things including the below.
- Set Accept Any SSH Server Host Key = True
- Change Encryption Cipher from Auto to AES (same error), TripleDES (Cipher error)
- Setting the Folder Path to / or .
- Changing the Connection Limit = 1
- Setting Polling Interval = 5 minutes
- Making sure that it is running on a 64 bit host
- Googling to try and find others that have encountered this and found a solution
I’ve posted about this on the thread Initialize error for SFTP adapter in BizTalk 2013 R2 which was very similar and on Open SFTP connection error which looks to be an identical error. There was one fix FIX: “Open SFTP connection” error when you use the SFTP adapter in BizTalk Server, which was part of CU1, so either the issue has regressed, or it is a different issue that throws the same error.
Any clues as to what the cause might be and how to resolve this apart from?
- Upgrading to BizTalk 2016
- Using the bLogical adapter
- Raising an issue with Microsoft (which will have to do if this cannot be resolved)
Receive Location:
The Messaging Engine failed to add a receive location "{ReceiveLocation}" with URL "sftp://{SERVER}:{PORT}/{FILEMASK}*.xml" to the adapter "SFTP". Reason: "Microsoft.BizTalk.Adapter.SftpInvoker.SftpException: Open SFTP connection error.
at Microsoft.BizTalk.Adapter.SftpInvoker.SftpInvoker.Open()
at Microsoft.BizTalk.Adapter.Sftp.SftpConnection.OpenUnderlyingConnection(SftpConnectionProperties connectionProperties)
at Microsoft.BizTalk.Adapters.CommonHelpers.Connection`3.ConnectionPool`3.GetConnection(T1 connectionProperties, TimeSpan timeout)
at Microsoft.BizTalk.Adapters.CommonHelpers.Connection`3.GetConnection(T connectionProperties, TimeSpan timeout)
at Microsoft.BizTalk.Adapter.Sftp.SftpRLConfig.ValidateConfiguration(SftpReceivePropertyBag receivePropertyBag)
at Microsoft.BizTalk.Adapter.Sftp.SftpRLConfig.CreateBinding(RHConfig rhConfig)
at Microsoft.BizTalk.Adapter.Wcf.Runtime.BtsServiceHostBase.InitializeRuntime()
at System.ServiceModel.ServiceHostBase.OnOpen(TimeSpan timeout)
at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfReceiveEndpoint.Enable()
at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfReceiveEndpoint..ctor(BizTalkEndpointContext endpointContext, IBTTransportProxy transportProxy, ControlledTermination control)
Send Port:
The adapter failed to transmit message going to send port "{SENDPORT}" with URL "sftp://{SERVER}:{PORT}/%SourceFileName%". It will be retransmitted after the retry interval specified for this Send Port. Details:"Microsoft.BizTalk.Adapter.SftpInvoker.SftpException: Open SFTP connection error.
Server stack trace:
at Microsoft.BizTalk.Adapter.SftpInvoker.SftpInvoker.Open()
at Microsoft.BizTalk.Adapter.Sftp.SftpConnection.OpenUnderlyingConnection(SftpConnectionProperties connectionProperties)
at Microsoft.BizTalk.Adapters.CommonHelpers.Connection`3.ConnectionPool`3.GetConnection(T1 connectionProperties, TimeSpan timeout)
at Microsoft.BizTalk.Adapters.CommonHelpers.Connection`3.GetConnection(T connectionProperties, TimeSpan timeout)
at Microsoft.BizTalk.Adapter.Sftp.SftpOutputChannel.Send(Message message, TimeSpan timeOut)
at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)
at System.Runtime.Remoting.Messaging.StackBuilderSink.AsyncProcessMessage(IMessage msg, IMessageSink replySink)
Exception rethrown at [0]:
at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)
at System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.End(SendAsyncResult result)
at System.ServiceModel.Channels.ServiceChannel.EndCall(String action, Object[] outs, IAsyncResult result)
Exception rethrown at [1]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at System.ServiceModel.Channels.IOutputChannel.EndSend(IAsyncResult result)
at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfClient`2.SendCallback(IAsyncResult result)".
As we were getting no were fast resolving this, we also tried the nSoftware adapter from a BizTalk 2010 server. Unfortunately this also didn’t work, but at least gave a meaningful error.
The adapter “nsoftware.SFTP v3” raised an error message. Details “Transmission failed for message “f99728a0-8791-42d7-b27e-c1d53feabd3e”: Error uploading SFTP file: Could not negotiate key exchange algorithm. Remote host supports the following algorithms: “diffie-hellman-group-exchange-sha256″.”.
According to the nSoftware documentation, this is supported (in V4), however the client only has V3 of that adapter (for which I cannot find the documentation so cannot confirm what is has to say about supporting that). I’ve confirmed it does work with V4 now.