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

Message for the SFTP Send Adapter remains in active state

Jun 22, 2010 at 2:54 AM

Hi Everyone,

I have issues with messages for the SFTP send adapter remain in active state. Has anyone experienced the same issues?
The SFTP send adapter has its own host.
The only way to force sending the messages are by doing the following steps:
1. Suspend the active instances
2. Restart the host
3. Resume the suspended instances

The DebugView shows these info for a successful transmission :
- [AsyncTransmitter] Enter
- [SftpTransmitProperties] ReadLocationConfiguration called  
- [SftpTransmitProperties] Username/Password Authentication  
- [SftpConnectionPool] GetConnectionFromPool found a free connection in the pool  
- [SftpTransmitterEndpoint] Sftp.Put /5e6de21e-b8ee-4643-bcd8-3c8893566c4d.xml  
- [SftpConnectionPool] ReleaseConnectionToPool releasing connection to pool  
- [AsyncTransmitter] Leave  

Whilst the "stuck/active" state shows:
- [AsyncTransmitter] Enter
- [SftpTransmitProperties] ReadLocationConfiguration called  
- [SftpTransmitProperties] Username/Password Authentication  
- [SftpConnectionPool] GetConnectionFromPool found a free connection in the pool  
- [SftpTransmitterEndpoint] Sftp.Put /380ee9fb-e673-4ef4-9189-807f20f4a00d.xml

It looks like that the connection is stuck and is not releasing to the pool.

FYI, the receive adapter seems to be working perfectly.

Any ideas/comments/suggestions, etc.?

Thanks and regards,
Eka
 

 

Jul 6, 2010 at 3:49 AM

Hi Mikael,

Any updates with this? Do you need any more details?

Thanks,
Eka

 

Coordinator
Jul 7, 2010 at 9:59 PM
Sorry for late reply, I'm on vacataion... Did you get anything in the eventlog? Such as ""Unable write file to...". //Mikael
Jul 9, 2010 at 12:49 AM

Hi Mikael,

Thanks for the reply. No, there is nothing in the event log (application/system log).
The only info that I can gather from is from the DebugView.
Unfortunately, we cannot get any log from the destination SFTP server.

I see a pattern with this.
It seems to happen on the first send after no activity or idle for few hours.
Since it is not a high volume, the system sends only a few messages in a day.
The first send will always stay in active state, the subsequent send seems to be ok.
But it will happen again for the next send if there is no activity or idle for few hours.
I wonder whether there is something wrong with the conncection pool. Because it is not releasing the connection to the pool.

I have also looked at the source code, the sending part is using the connection pool but the receiving part is not using it.
Will it make any differences if the sending part is not using the connection pool?

Thanks,
Eka

 

Jul 15, 2010 at 4:11 PM

 

Hi I am getting a similar issue - 

I am using 3 different SFTP user accounts which point to 3 different locations on the same server. One file Transfers fine, but the other two are suspended and never reach their destination.

In the event log I get the "Unable write file to" error.

Could you please let me know of any fix for this?

 

Thanks,

 

Vishal

Coordinator
Jul 17, 2010 at 11:19 AM
Vishal: Does the file exist in the source folder? Are you using "%SourceFileName%" macro? //Mikael
Coordinator
Jul 18, 2010 at 11:50 PM
Ekasenna: I'm working on fixing this now. Let me know if you have any input. You can reach me through IM on my blog http://blogical.se/blogs/mikael
Coordinator
Jul 18, 2010 at 11:52 PM
Vishal: Would you by any chance be a collegue of Stephen Thomas. He pointed me to a similar problem. //Mikael
Jul 19, 2010 at 8:02 AM
wmmihaa wrote:
Ekasenna: I'm working on fixing this now. Let me know if you have any input. You can reach me through IM on my blog http://blogical.se/blogs/mikael

 Mikael: Thanks for looking into this. Please let me know if you need anything from me to help your troubleshooting.

Jul 19, 2010 at 11:11 AM
Edited Jul 19, 2010 at 2:42 PM
wmmihaa wrote:
Vishal: Does the file exist in the source folder? Are you using "%SourceFileName%" macro? //Mikael

Thanks for looking into this - Yes I am using this macro and I'm not a colleague of Stephen Thomas.

How long do we think this will take?

Vishal

Coordinator
Jul 19, 2010 at 8:17 PM

Sorry guys, I wanted to do some testing before I made it public. The Blogical.Shared.Adapters.SFTP v1.3.6 Setup - BETA is available on the download tab.

The main difference is the ability to disable the send port connection pool. I think (and hope) this will solve both your problems. Ekas problem should be solved as the adapter creates a new connection each time it sends a file. The problem Vishal is experiencing is a bit different, and relates to the fact that you're using different accounts for the same ssh server. The send port picks the first available connection object connected to a specific ssh server, and does not take user accounts in consideration. Of course, disabling the connection pool should solve this problem, but it could also be solved by having multiple BizTalk hosts adapter handlers.

Disabling the connection pool is not generally a good thing though. It’s there for a reason, and BizTalk can generate a LOT of load on a ssh server, which can cause problems. This is particularly true when the ssh servers is hosted on windows.

Lastly. Thank you for the submitting these problems. I would really really really appreciate some feedback from the both of you.

HTH

//Mikael

 

Jul 20, 2010 at 11:44 AM

Thanks for this - I have gone with multiple BizTalk hosts adapter handlers over installing the beta adapter as it is in a live environment. It works nicely now :)

Regards,

 

Vishal

 

Sep 7, 2010 at 7:59 AM

Hi Mikael,

Sorry for the very late reply. 
I just notice that there is version 1.3.7 available now so I assume you have done further testing too.
Anyway, I will test this and update you later.

Thanks,
Eka

Coordinator
Sep 7, 2010 at 9:35 AM

Thanks, I appreciate it!

//Mikael

Sep 20, 2010 at 8:14 AM
wmmihaa wrote:

Thanks, I appreciate it!

//Mikael

 Hi Mikael,

We have tested it and it did fix the issue.

Thanks,
Eka

Coordinator
Sep 22, 2010 at 6:59 AM

Great new, glad I could help. (don't forget to rate the project ;) )

//Mikael

Oct 13, 2010 at 9:49 PM

Hi Everyone,

I am getting below error while sending file using SFTP send port. It was working fine few weeks back,  Now it's giving below error on event viewer, please help me out to resolve this.

Description: Method: Blogical.Shared.Adapters.Sftp.SharpSsh.Sftp.connect Error: Unable to connect to Sftp host [xxxxxxx]

 Message: Unable to connect to Sftp host [xxxxxxx]

 Type: Tamir.SharpSsh.jsch.JSchException Target: Void connect(Int32)

Message: invalid server's version String

Stacktrace: at Tamir.SharpSsh.jsch.Session.connect(Int32 connectTimeout) at Tamir.SharpSsh.SshBase.ConnectSession(Int32 tcpPort) at Tamir.SharpSsh.SshBase.Connect(Int32 tcpPort) at Blogical.Shared.Adapters.Sftp.SharpSsh.Sftp.connect(Boolean force)

Initially i have installed BlogicaL SFTP adapter version 1.3 but after looking at this error i have updated the adapter to version 1.4

 

Thanks,

chai

Coordinator
Oct 14, 2010 at 7:26 AM

Hi Chai,

The error indicates that something has changed on the server side.

//Mikael

Oct 14, 2010 at 3:48 PM

Thanks Mikael, We are investigating what has been changed on the SFTP server. I will update you on this.

Oct 21, 2010 at 5:55 PM
Edited Oct 21, 2010 at 7:14 PM

Hi Mikael

below is the SFTP adapter trace. Could you please help me out why SFTP adapter stoped sending files onto sftp server,  the messages are getting suspended in BizTalk group hub. It used to send messages successfully. It was ideal for some time, then we have started sending the messags again on the same port. We came to know that nothing has changed on the server side.  Could you pls help us to straighten this out.

 

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 /Test_f6b4bdfc-9b65-43e6-abf3-149fdbb9d0b5

[SftpConnectionPool] Connecting to xxxxxxxxxxxxxxxxx

[AsyncTransmitter] Enter

[SftpTransmitProperties] ReadLocationConfiguration called

[SftpTransmitProperties] Username/Password Authentication

[SftpConnectionPool] Overriding connection pool settings

[SftpConnectionPool] GetConnectionFromPool creating a new connection for pool

[SftpTransmitterEndpoint] Sftp.Put /Test_6eba0f87-384a-4fb3-a07b-e1a7456c5fba

[SftpConnectionPool] Connecting to xxxxxxxxxxxxxxxxx

[AsyncTransmitter] Enter

[SftpTransmitProperties] ReadLocationConfiguration called

[SftpTransmitProperties] Username/Password Authentication

[SftpConnectionPool] GetConnectionFromPool creating a new connection for pool

[SftpTransmitterEndpoint] Sftp.Put /Test_d28d7b12-8011-448f-a554-f8d467cdf6ee

[SftpConnectionPool] Connecting to xxxxxxxxxxxxxxxxx

[SftpConnectionPool] Disconnecting from xxxxxxxxxxxxxxxxx

[SftpConnectionPool] Connection has timed out

[SftpConnectionPool] Reconnecting to xxxxxxxxxxxxxxxxx

[SftpConnectionPool] Connecting to xxxxxxxxxxxxxxxxx

[SftpConnectionPool] Disconnecting from xxxxxxxxxxxxxxxxx

[SftpConnectionPool] Connection has timed out

[SftpConnectionPool] Reconnecting to xxxxxxxxxxxxxxxxx

[SftpConnectionPool] Connecting to xxxxxxxxxxxxxxxxx

[SftpConnectionPool] Disconnecting from xxxxxxxxxxxxxxxxx

[SftpConnectionPool] Connection has timed out

[SftpConnectionPool] Reconnecting to xxxxxxxxxxxxxxxxx

[SftpConnectionPool] Connecting to xxxxxxxxxxxxxxxxx

Oct 21, 2010 at 7:12 PM

We have initially installed version 1.3 , then we have updated sftp adapter to version 1.4 downloaded from codeplex. Are there any sequence of steps that we need to follow to install version1.4.  We still see that same error after upgrading to version 1.4 ... Could you please help me out that we are on the right track to trace the issue.

Coordinator
Oct 21, 2010 at 7:49 PM

Hi Canugu,

Do yo have any error messages in the server log? You could try setting the connection pool to "0". This will force the adapter to create a new connection each time it sends a message.

HTH

//Mikael

May 9, 2011 at 4:35 PM

We were facing the same issue.  The problem ended up being that the connection pooling on the send side only compared host names.  If you had multiple user accounts all pointed at the same host - you would pull a connection out of the pool that did not have access to the directory you were trying to drop the file off to.

I fixed it by adding another public string to the "host" class inside the SftpConnectionPool.cs file.  I then check both host name and username when getting the host (gethostbyname) method.  This has solved our issue.

Sep 27, 2011 at 11:34 PM

Mikael is it possible to add utahjasonjones suggestion to the code base? A boolean flag that states include username in connection pool identity would prevent the issue of multiple users accounts on a single server address failing.

Are you talking on any more contributors for the adapter? We would be more than happy to contribute an update for this.

Regards

Nikolai