Page 1 of 1
issue with Sbridge ssh sftp client disconnect on sbridge server
Posted: Wed 18 Dec 2019 19:34
by tcaduto12068
I'm having a error popup when I connect to my sbridge server using a sbridge client:
(
using latest version of sbridge on Lazarus 2.06)
Code: Select all
12/18/2019 01:30:00 PM:[Error] SSH Client(127.0.0.1:50920) ERROR for user:testuser:Error on data reading from the connection:
An established connection was aborted by the software in your host machine..
This only happens with the sbridge sftp and ssh client, if I use filezilla etc no error.
Is this the proper way to use the devart SFTP Client?
Code: Select all
sftpmod.SSH.HostName:=maindatamod.FTPAddress;
sftpmod.SSH.Port:=10022;
sftpmod.SSH.User:=username;
sftpmod.SSH.Password:=PassWord;
sftpmod.SSH.Connect;
if sftpmod.SSH.Connected then
begin
if not sftpmod.SFTP.Active then
sftpmod.SFTP.Initialize;
sftpmod.SFTP.UploadFromStream(astream,'/'+testfilename,true);
MessageDlg(self,'Success','Test file uploaded successfully.',mtInformation,[mbok],0);
sftpmod.sftp.Disconnect;
sftpmod.SSH.Connected:=false;
end;
Re: issue with Sbridge ssh sftp disconnect on sbridge server
Posted: Wed 18 Dec 2019 19:50
by tcaduto12068
Well no idea why this works but it gets rid of the error on the server:
Code: Select all
sftpmod.sftp.Disconnect;
sleep(500);
sftpmod.SSH.Disconnect;
sleep(500);
Anyone have any idea why I have to add sleeps ?
The error on the Sbridge server is occurring in the OnClientError Event.
It's almost as if there is some kind of threading issue (missing a wait maybe?)with the SFTPClient component. I can go as low as 200ms in the sleeps before the error happens again.
I tried a bunch of other SFTP clients and the error does not happen with any of them, just the SecureBridge client component.
Any hints on if I am not using the SFTP and SSH client components properly?
Re: issue with Sbridge ssh sftp client disconnect on sbridge server
Posted: Fri 20 Dec 2019 09:35
by ViktorV
Please try to use night build of SecureBridge which we sent you and inform us about the results.
Re: issue with Sbridge ssh sftp client disconnect on sbridge server
Posted: Fri 20 Dec 2019 14:01
by tcaduto12068
ok, I will check it out and report back :-) Thanks :-)
Re: issue with Sbridge ssh sftp client disconnect on sbridge server
Posted: Fri 20 Dec 2019 14:19
by tcaduto12068
No change with the nightly build:
Code: Select all
12/20/2019 08:13:37 AM:[Error] SSH Client(127.0.0.1:59332) ERROR for user:testuser:Error on data reading from the connection:
An established connection was aborted by the software in your host machine..
Socket Error Code: 10053($2745)
This is the disconnect code I used on the client side:
Code: Select all
if (SSH.Connected) then
begin
SFTP.Disconnect;
//sleep(100);
SSH.Disconnect;
// sleep(100);
end;
I can get that same error with Filezilla or other client if I kill it from the task manager. It's like the client component is not waiting for the response from the server when shutting down.
Re: issue with Sbridge ssh sftp client disconnect on sbridge server
Posted: Fri 20 Dec 2019 22:04
by tcaduto12068
Update, I also ran everything on Linux and the error behavior is different and worse on Linux (Manjaro latest)
What happens on Linux is I connect with the client component do a directory listing and that works fine, then I let the client sit and it disconnects by itself on exactly the 15 second timeout defined in the client components properties with this error
https://photos.app.goo.gl/hFpgz2WyaWSBvNzC6
As on windows the server is working perfectly with other clients like the Linux version of FileZilla, ssh command line etc.
Re: issue with Sbridge ssh sftp client disconnect on sbridge server
Posted: Mon 23 Dec 2019 15:14
by Dimon
Thank you for the information.
A distinctive feature of SSH protocol is that it doesn't send any special package to the server when closing the connection -- SSH simply closes the physical connection. This error suggests that the connection was closed on the SSH client side. We'll change the behavior of the SSH server to prevent the associated event for this error.
Re: issue with Sbridge ssh sftp client disconnect on sbridge server
Posted: Sat 28 Dec 2019 03:25
by tcaduto12068
The secure bridge client did not exhibit this behavior a few versions ago and other clients don't cause the error on the secure bridge server, it seems to be a issue with the sb client. I started to notice this behavior maybe around April 2019.
Re: issue with Sbridge ssh sftp client disconnect on sbridge server
Posted: Mon 30 Dec 2019 07:11
by tcaduto12068
I just installed the latest version you guys released on Friday and the issue is gone on Windows.
Will try on Linux in the morning. Thanks :-)
Re: issue with Sbridge ssh sftp client disconnect on sbridge server
Posted: Mon 30 Dec 2019 12:33
by ViktorV
When you get any results concerning this question, please let us know.