This project is read-only.

Enabling debugging for SSH library

Jan 30, 2013 at 8:56 PM
Hi there
I've posted on here before regarding this, but didn't get any bites..

Is there any way to have the SSH library emit and debugging output?

Our application initiates 20 or so concurrent SSH requests on worker threads, and fairly often, it appears that the ssh Connect call never returns (no exception, no return value), and thus that thread is sort of hung up in limbo.

It would be great to be able to see some debugging output from the library so I can get a better idea of how where it's at ...

Any ideas would be appreciated!
Michael
Jan 31, 2013 at 8:51 PM
Hi Michael,
I too am having difficulty using this library when threaded (windows service). The connections fail in random frequency. The only way to get things to clear is to stop and start the service, so something is definitely in limbo as you say. I applaud the hard work put forth by those who manage this project, but as it sets, I cannot use this library.
The main reason I am responding is because- if nobody other than you says anything, then the problem will appear more isolated that it really is.
Are you using the 3.5 or 4 version?
Thanks, Mike
Jan 31, 2013 at 9:10 PM
Edited Jan 31, 2013 at 9:12 PM
Nice to hear from you.

I'm using the 2013.1.8 release for 4.0. My app is compiled for .NET 4.5.

In general I've found the library to be pretty reliable, and like you, I'm very grateful that it was written and is being maintained.

Our application regularly launches 20 - 40 virtual cloud computers and then interacts asynchronously with them via the Renci SSH library. I use C#5.0's new async features and Task.Run() to start SSH activity concurrently on multiple threadpool threads.

Each thread follows this model: open ssh connection, do activity (file upload or download, or exec remote command) and close connection. None of the files are large and none of the remote commands take more than a second or two to finish. As I mentioned above, there may be between 20 and 40 such threads running at the same time.

A given run of the application can last for 72+ hours and thus issue 20,000+ SSH requests before it ends (the program interacts with the virtual instances about every 5-15 seconds, to put a file , get a file, and so on)

Sometimes the app can run a whole weekend and everything is great. But too often, one of my calls to Connect() never returns. I'm checking for exceptions but in these cases am not getting one. I emit a debugging message before the connect and after the connect - I get the debugging message before the connect, but not the message after the connect.

I hate to switch to another library because I have 8+ months invested in using and testing with this library, but this particular problem may force me to switch libraries.
Coordinator
Feb 1, 2013 at 4:23 AM
Hi,

Sorry for late response but I am busy now with another project at work so dont have much free time now.
Recently I tried to improve on all hanging issues, specifically in connect method, but it seems I still missing something.
There are some debugging messages that are being generated by the library but this part was created by another developer who created a web page where he explains how to turn them on so please check out this url

If you can pinpoint to where it hangs please let me know and I will try to fix it as soon as possible, unfortunalty I know that those kind of problems is hard to replicate.

Hope it helps.
Thanks,
Oleg
Feb 1, 2013 at 6:18 PM
<div dir="ltr"> <div>Thanks so much for your reply. I will check out the debugging link you have provided and post back with any findings.<br> <br> </div> Good luck on your work project!<br> Michael<br> </div> <div><br> <br> <div>On Thu, Jan 31, 2013 at 11:23 PM, olegkap <span dir="ltr">&lt;<a href="mailto:notifications@codeplex.com" target="_blank">notifications@codeplex.com</a>&gt;</span> wrote:<br> <blockquote style="margin:0 0 0 .8ex; border-left:1px #ccc solid; padding-left:1ex"> <div> <p>From: olegkap</p> <div>Hi, Sorry for late response but I am busy now with another project at work so dont have much free time now. Recently I tried to improve on all hanging issues, specifically in connect method, but it seems I still missing something. There are some debugging messages that are being generated by the library but this part was created by another developer who created a web page where he explains how to turn them on so please check out this [url](<a href="http://sshnet.codeplex.com/wikipage?title=Troubleshooting%20SSH.NET&referringTitle=Documentation" target="_blank">http://sshnet.codeplex.com/wikipage?title=Troubleshooting%20SSH.NET&referringTitle=Documentation</a>) If you can pinpoint to where it hangs please let me know and I will try to fix it as soon as possible, unfortunalty I know that those kind of problems is hard to replicate. Hope it helps. Thanks, Oleg</div> <div> <div> <p>Read the <a href="http://sshnet.codeplex.com/discussions/431467#post994996" target="_blank"> full discussion online</a>.</p> <p>To add a post to this discussion, reply to this email (<a href="mailto:sshnet@discussions.codeplex.com?subject=[sshnet:431467]" target="_blank">sshnet@discussions.codeplex.com</a>)</p> <p>To start a new discussion for this project, email <a href="mailto:sshnet@discussions.codeplex.com" target="_blank"> sshnet@discussions.codeplex.com</a></p> <p>You are receiving this email because you subscribed to this discussion on CodePlex. You can <a href="https://sshnet.codeplex.com/discussions/431467/unsubscribe/" target="_blank"> unsubscribe</a> on CodePlex.com.</p> <p>Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com</p> </div> </div> </div> </blockquote> </div> <br> </div>