0 votes
by (300 points)
edited

I'm having problems executing commands with client.runcommand some commands works and some others fails (this particular command was grep), heres is the log:

2011-12-12 12:42:39.851 DEBUG Ssh(1) Info: Received 16384 bytes of data.
2011-12-12 12:42:39.851 DEBUG Ssh(1) Info: Received 16384 bytes of data.
2011-12-12 12:42:39.851 DEBUG Ssh(1) Info: Received 16384 bytes of data.
2011-12-12 12:42:39.867 DEBUG Ssh(1) Info: Received 16384 bytes of data.
2011-12-12 12:42:39.867 ERROR Ssh(1) SSH: Rebex.Net.SshException: The channel has been closed.
   at Rebex.Net.SshChannel.clmbOg(BBdsJfZ )
   at Rebex.Net.SshChannel.bOrbyiZ()
   at Rebex.Net.SshChannel.Receive(Byte[] buffer, Int32 offset, Int32 count)
by (147k points)
edited

A workaround for a similar problem has been added to the next release but not released yet. I will mail you a link to the current build of Rebex SSH Pack - please give it a try and let me know if the problem persists.

2 Answers

0 votes
by (300 points)
edited

Hi Lukas, I tried with the link you send me but unfortunately it doesn't work.. same error.. How can I know what is causing that error? I try the exact same "grep" command with 2 different files, one works well while the other shows that SshException

by (72.7k points)
edited

Could you please create two communication logs in Verbose mode and send it to us at support@rebex.net. One for grep with a failure and second one for the grep without a failure. We can tell you more after analyzing the log files.

Please create the log as follows:

Ssh client = new Ssh();
client.Connect(...);
client.Login(...);

client.LogWriter = 
client.Session.LogWriter = 
    new Rebex.FileLogWriter("c:/temp/ssh.log", Rebex.LogLevel.Verbose);
client.RunCommand("your grep command");
by (300 points)
edited

Email sent, thank you Lukas.

by (300 points)
edited

Problem Solved with new version (4368) thank you!

0 votes
by (147k points)
edited

Thanks for letting us know about this issue! This was caused by a bug in SSH code and it will be fixed in the next release.

UPDATE

The fix is included in Release 2012 R1. SshChannel no longer attempts to adjust window size after the channel has been closed.

...