0 votes
by (160 points)
edited

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

http://forum.rebex.net/questions/342/ssh-runcommand-vs-startcommand-for-stdout-stderr-and-exit-code/347#347

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.

Thanks

1 Answer

0 votes
by (144k points)
edited

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.

by (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.
by (144k points)
edited

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

...