"The operation was not completed within the specified time limit." exception when closing SSH Channel

0 votes
asked Feb 21, 2011 by Ian (160 points)
edited Mar 19, 2012

Hi, I'm using the code Lukas supplied in reply to a previous question of mine:


I'm using it to run an Expect script and it works great most of the time.

Sometimes though we get the error below when it tries to close the underlying channel. The Expect script I'm running seems to have completed fine but we still get the error on close.

The operation was not completed within the specified time limit.
at Rebex.Net.SshSession.BXQTfX(Int32 ) 
at Rebex.Net.SshSession.AePCoRZ(Byte[]& ) 
at Rebex.Net.SshSession.cDtmAOZ(Int64& , Boolean ) 
at Rebex.Net.SshChannel.cDtmAOZ(Boolean , Int64& ) 
at Rebex.Net.SshChannel.Close() 

There can be multiple independent Rebex.Ssh sessions open at once all running different Expect scripts so I'm wondering if perhaps they are blocking causing random ones to timeout when trying to close, especially as re-running a failed one again usually completes and closes without error.

I've set _ssh.Timeout to be higher than the time the Expect script takes when run manually but the error still randomly happens.

I'm adding LogWriter to create a communication log but wondered if there was any known issues or suggestions to look at in the meantime.


1 Answer

0 votes
answered Feb 22, 2011 by Lukas Pokorny (128,250 points)
edited Mar 19, 2012

The latest release of Rebex SSH Shell fixed a possible race condition that might have occurred when running several SshChannels over a single SshSession. I'm not sure whether this is related to the problem you encountered, but upgrading your application to latest release of Rebex SSH Shell is recommended.

If the problem persists in the latest release, please add the LogWriter log (at Debug lebel) to your question (or mail it to support@rebex.net if it's too long) - that should make it possible to tell what is going on.

Alternatively, post a piece of code and a sample Expect script that reproduce this issue - we should be able to fix this easily without any further help from you if we are able to reproduce it.

commented Mar 10, 2011 by Ian (160 points)
Thanks Lukas. I upgraded to the latest version but the problem still occurs. I've sent the log and example Expect script by email.
commented Mar 19, 2012 by Lukas Pokorny (128,250 points)
edited Mar 19, 2012

This issue was most likely fixed in version 2012 R1 (http://www.rebex.net/sftp.net/history.aspx#4444).