fieldrndservices / libssh2-labview

A LabVIEW library for SSH client support via libssh2
Apache License 2.0
21 stars 2 forks source link

Create Channel From Session fails #60

Open Clio75 opened 1 year ago

Clio75 commented 1 year ago

Hi and thanx for this grate lib.

I have used it some time now, and I don't know what may have changed. But now I get error in the Create channel from session

image image

when I get into this VI everything seams to be in order(44) image

Even the Path to the dll seams to be correct(46) image

But out of the Call Liberian function I get error -12, witch give me error : image

let me know if you need more from me to locate this unwanted feature.

PS: From my experience, It can be dangerous to remove information from the wire. I see that if there are an error in this VI all session information is removed from the wire. Please consider to leave the session information on the wire to ensure correct close/disconnect at the end :)

volks73 commented 1 year ago

Thank you for your usage and interest in the project and toolkit.

I have pushed a new release or modified the main branch of this toolkit for little over a year. I do not think there are any changes that would have suddenly made the toolkit fail.

However, the timeout error seems to indicate that a response from the remote host was not received in time. Was the SSH server on the remote host possibly updated recently? An incompatibility between the version of libssh2 used in this toolkit and the remote SSH server software could have arisen.

Are you able to use PuTTY or Git Bash or Windows 10 OpenSSH client to connect to the remote SSH server without error?

Clio75 commented 1 year ago

Hi, SSH server is on a new product we are developing. And the software on this is in constant development, so it can happen that it have been updated without anyone have told me :) Yes I can always login to the unit with putty, and I have never seen timeout error problems before.

I have made a "workaround" image

It always connect in second or Third attempt, never on the first attempt. Let me know if there are more I can add

volks73 commented 1 year ago

I am happy to hear you have found a workaround.

Have you tried the https://github.com/fieldrndservices/libssh2-labview/blob/main/src/Toolkit/Session/Write%20Timeout.vi VI for the session object before using the Create Channel VI? From the documentation:

Sets the timeout in milliseconds (ms) for reading and writing during the communication with a remote SSH/SFTP server.

The default read/write timeout might be to short and your network latency/bandwidth has changed recently due to more devices added to the network, packet shaping from IT department, cable degradation/change (Cat5e or Cat6?), other parts of the code/system "spamming" packets on the network, solar flare (kidding), etc. Increasing the timeout may negate the need for your workaround. Given it works on the second or third attempt, this seams like a reasonable source for the new issue.