LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

SFTP Error: The SFTP session has disconnected unexpectedly (Error code -5580899)

Solved!
Go to solution

Hello,

I'm trying to connect to a SFTP server using LabVIEW (LV2023). I'm using the SFTP APIs included in the VI.lib.

I am sure that the SFTP server is working fine. I can successfully connect using FileZilla.

 

In LV, the Connect.vi returns the following error:

 

************************************

Code: -5580899

set "LVASKPASS_PATH=\\.\Pipe\LOCAL\lvsshpw.<my Windows user>"& set "SSH_ASKPASS=C:\Program Files\National Instruments\LabVIEW 2023\resource\lvaskpass.exe"& set "SSH_ASKPASS_REQUIRE=force"& set "DISPLAY=:0"& "ssh" -p 22 -o StrictHostKeyChecking=accept-new -s <SSH user>@<SSH server> sftp

************************************

NOTE 1: In the error description above, I have removed some information for privacy reasons. Removed data is included in the '<' and '>' brackets.

NOTE 2: connection is password-based.

 

 

sftp_error2.png

 

 

 

 

 

Can you help me?

 

 

 

 

0 Kudos
Message 1 of 8
(774 Views)

Try if you can use OpenSSH for Windows from Power Shell or Windows Terminal SSH

-------------------------------------------------------
Applications Engineer | TME Systems
0 Kudos
Message 2 of 8
(739 Views)

With OpenSSH in Windows Powershell, I receive this error:

 

"PTY allocation request failed on channel 0"

 

Any idea?

 

 

0 Kudos
Message 3 of 8
(720 Views)

Any suggestion? 😞

0 Kudos
Message 4 of 8
(693 Views)

From what I found for that error message, the server does not allow an interactive session. I guess that is required for password authentication from LabVIEW.

 

Does it work when you use sftp instead of ssh from the command line?

 

You can use key-based authentication instead of username/password. Here is an article how to set that up for a windows server: https://learn.microsoft.com/en-us/windows-server/administration/openssh/openssh_keymanagement

You basically generate a key pair and put the public key into a file on the server. We use that approach with cRIOs.

0 Kudos
Message 5 of 8
(687 Views)

I don't have any issues running SSH from PowerShell or CMD.

 

Perhaps you can try to search online.

I did a quick Google and found this. From ssh - How to fix request failed on channel 0 - Stack Overflow

The client is requesting a shell session with a TTY and the server is rejecting it. The server doesn't provide the client with a detailed reason why the request was rejected. You need to troubleshoot this on the server rather than the client.

 

 

-------------------------------------------------------
Applications Engineer | TME Systems
0 Kudos
Message 6 of 8
(683 Views)
Solution
Accepted by SlippinJimmy85

No way to use the LabVIEW SFTP native library succesfully.

I solved the problem creating a wrapper of WINSCP.

https://winscp.net/eng/docs/library

0 Kudos
Message 7 of 8
(55 Views)

@SlippinJimmy85 wrote:

No way to use the LabVIEW SFTP native library succesfully.

I solved the problem creating a wrapper of WINSCP.

https://winscp.net/eng/docs/library


Do you know for a fact that there is no way?  It's probably more appropriate to say "I couldn't find a way" otherwise.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 8 of 8
(43 Views)