Rebex.Net.SshException: Cannot perform requested operation in currect session state.

0 votes
asked Mar 3, 2012 by Duen-wen Hsiao (160 points)
edited Jun 13, 2012

I download the trail sftp package and sample program to test. However, I keep getting

Rebex.Net.SftpException: Cannot perform requested operation in currect session state. ---> Rebex.Net.SshException: Cannot perform requested operation in currect session state.
at Rebex.Net.SshSession.ArwjUr(Byte[] )
at Rebex.Net.SshSession.Negotiate()
at Rebex.Net.Sftp.Connect(String serverName, Int32 serverPort, SshParameters parameters)
--- End of inner exception stack trace ---
at Rebex.Net.Sftp.Connect(String serverName, Int32 serverPort, SshParameters parameters)
at ConsoleApplication1.Program.Main(String[] args) in c:usersdwhdocuments visual studio 2010ProjectsConsoleApplication1ConsoleApplication1Program.cs:line 47

Does anybody experienced this error before?


Also, I tried the ssh package as well. Same error.
Rebex.Net.SshException: Cannot perform requested operation in currect session state.
at Rebex.Net.SshSession.ArwjUr(Byte[] )
at Rebex.Net.SshSession.Negotiate()
at Rebex.Net.Ssh.Connect(String serverName, Int32 serverPort, SshParameters parameters)
at Rebex.Net.Ssh.Connect(String serverName)
at ConsoleApplication1.Program.Main(String[] args) in c:usersdwhdocumentsvisual studio 2010ProjectsConsoleApplication1ConsoleApplication1Program.cs:line 19


Also, another piece of info. When I run in debug mode within C#, I see that the exception was due to an
_COMPlusExceptionCode of 0xe0434352
with
_HResult of 0x80131500

Looks like these are pretty generic but hopefully, it's a hint for somebody who can decipher the error.


Sorry for the late reply. Was on vacation. Anyway, thanks for the reply. I actually did use the LogWriter. With Rebex.LogLevel.Debug, the log file contains the following after I got the error while trying to use ssh package.

2012-03-23 21:04:13.997 Opening log file.
2012-03-23 21:04:14.153 INFO Ssh(1) Info: Connecting to cois-linux.austincc.edu:22 using Ssh 1.0.4086.0 (trial version).
2012-03-23 21:04:14.200 ERROR Ssh(1) SSH: Rebex.Net.SshException: Cannot perform requested operation in currect session state.
at Rebex.Net.SshSession.ArwjUr(Byte[] )
at Rebex.Net.SshSession.Negotiate()
2012-03-23 21:04:14.200 ERROR Ssh(1) Info: Rebex.Net.SshException: Cannot perform requested operation in currect session state.
at Rebex.Net.SshSession.ArwjUr(Byte[] )
at Rebex.Net.SshSession.Negotiate()
at Rebex.Net.Ssh.Connect(String serverName, Int32 serverPort, SshParameters parameters)

commented Mar 5, 2012 by Lukas Pokorny (112,030 points)
edited Mar 5, 2012

The "Cannot perform requested operation in currect session state" was most likely thrown while Rebex SFTP was trying to send a "disconnect" SSH packet to the server even though the connection was already broken due to another error that occurred before this one. Please try using Sftp object's LogWriter property (as described at http://www.rebex.net/kb/logging.aspx) to create a communication log and either add it to your forum post or mail it to support@rebex.net for analysis. Thanks!

1 Answer

0 votes
answered Apr 12, 2012 by Duen-wen Hsiao (160 points)
edited Jun 13, 2012

I talked to the Rebex support. This is a bug in Rebex and they fixed it. The bug # is 7672.

commented Apr 12, 2012 by Lukas Pokorny (112,030 points)
edited Apr 12, 2012

Thanks! To clarify the problem a bit - this exception is raised when the connection to the server is closed immediately. A "connection was closed" error should be raised instead.

commented Jun 13, 2012 by Lukas Pokorny (112,030 points)
edited Jun 13, 2012

This has been fixed in Rebex SFTP / SSH Shell 2012 R2.

...