0 votes
ago by (120 points)

Hello, When I use large file to transfer, getting below mentioned error.
[16:18:47 INF] Rebex.Net.Sftp 1 SSH Disconnected by the server ('The maximum idle time has been exceeded. - RequestId:128dfda3-401e-002d-0b0f-30d52a000000 Time:2023-01-24T16:18:47.3484530Z').
[16:18:47 INF] Sending file /SendBox/Upload/1GBFile.zip.pgp to FTP
[16:18:47 ERR] Rebex.Net.Sftp 1 SSH Rebex.Net.SshException: Disconnected by the server ('The maximum idle time has been exceeded. - RequestId:128dfda3-401e-002d-0b0f-30d52a000000 Time:2023-01-24T16:18:47.3484530Z').
at Rebex.Net.SshSession.ctbzj(nadzz p0, Boolean p1)
at Rebex.Net.SshChannel.jznhu(Byte[] p0, Int32 p1, Int32 p2)
at Rebex.Net.SshChannel.Send(Byte[] buffer, Int32 offset, Int32 count)
[16:18:47 ERR] Rebex.Net.Sftp 1 Info Rebex.Net.SshException: Disconnected by the server ('The maximum idle time has been exceeded. - RequestId:128dfda3-401e-002d-0b0f-30d52a000000 Time:2023-01-24T16:18:47.3484530Z').
at Rebex.Net.SshSession.ctbzj(nadzz p0, Boolean p1)
at Rebex.Net.SshChannel.jznhu(Byte[] p0, Int32 p1, Int32 p2)
at Rebex.Net.SshChannel.Send(Byte[] buffer, Int32 offset, Int32 count)
at nnaak.nllyd.ldqiu(nadzz p0, ehloh p1)
at nnaak.nllyd.qvpej(nadzz p0, UInt32 p1, tnwbk p2, ehloh p3)
at nnaak.nllyd.cngnp(nadzz p0, UInt32 p1, ehloh p2)
at nnaak.nllyd.anoln(String p0, tkeml p1, Boolean p2, ehloh p3)
at Rebex.Net.Sftp.ezyyg(tkeml p0, ehloh p1, String p2, Stream p3, Int64 p4, Int64 p5, emxzq p6)
[16:18:47 ERR] On SendFileToSFTP Method: SendSFTPAsyncService - Error: Rebex.Net.SftpException: Disconnected by the server ('The maximum idle time has been exceeded. - RequestId:128dfda3-401e-002d-0b0f-30d52a000000 Time:2023-01-24T16:18:47.3484530Z').
---> Rebex.Net.SshException: Disconnected by the server ('The maximum idle time has been exceeded. - RequestId:128dfda3-401e-002d-0b0f-30d52a000000 Time:2023-01-24T16:18:47.3484530Z').
at Rebex.Net.SshSession.ctbzj(nadzz p0, Boolean p1)
at Rebex.Net.SshChannel.jznhu(Byte[] p0, Int32 p1, Int32 p2)
at Rebex.Net.SshChannel.Send(Byte[] buffer, Int32 offset, Int32 count)
at nnaak.nllyd.ldqiu(nadzz p0, ehloh p1)
at nnaak.nllyd.qvpej(nadzz p0, UInt32 p1, tnwbk p2, ehloh p3)
at nnaak.nllyd.cngnp(nadzz p0, UInt32 p1, ehloh p2)
at nnaak.nllyd.anoln(String p0, tkeml p1, Boolean p2, ehloh p3)
at Rebex.Net.Sftp.ezyyg(tkeml p0, ehloh p1, String p2, Stream p3, Int64 p4, Int64 p5, emxzq p6)
--- End of inner exception stack trace ---
at Rebex.Net.Sftp.ezyyg(tkeml p0, ehloh p1, String p2, Stream p3, Int64 p4, Int64 p5, emxzq p6)
at Rebex.Net.Sftp.pozjt(Object p0, Enum p1, Object[] p2)
at nnaak.toymy.crbij(Object p0)
--- End of stack trace from previous location where exception was thrown ---
at SftpSendAsync.Application.DomainServices.SftpHelper.SendFiletoSftp(String localFilePath, String remotePath) in /src/SftpSendAsync.Application/DomainServices/SFTPHelper.cs:line 123
at SftpSendAsync.Application.DomainServices.SftpHelper.SendFileToSFTP(String uploadFile, String path, String fileName, CancellationToken cancellationToken) in /src/SftpSendAsync.Application/DomainServices/SFTPHelper.cs:line 103
[16:18:47 ERR] Exception occured while processing work item EIN20230119002619 for step Id 645c97e6-8181-4e27-968d-0a4375b9c8d1.
Rebex.Net.SftpException: Disconnected by the server ('The maximum idle time has been exceeded. - RequestId:128dfda3-401e-002d-0b0f-30d52a000000 Time:2023-01-24T16:18:47.3484530Z').
---> Rebex.Net.SshException: Disconnected by the server ('The maximum idle time has been exceeded. - RequestId:128dfda3-401e-002d-0b0f-30d52a000000 Time:2023-01-24T16:18:47.3484530Z').
at Rebex.Net.SshSession.ctbzj(nadzz p0, Boolean p1)
at Rebex.Net.SshChannel.jznhu(Byte[] p0, Int32 p1, Int32 p2)
at Rebex.Net.SshChannel.Send(Byte[] buffer, Int32 offset, Int32 count)
at nnaak.nllyd.ldqiu(nadzz p0, ehloh p1)
at nnaak.nllyd.qvpej(nadzz p0, UInt32 p1, tnwbk p2, ehloh p3)
at nnaak.nllyd.cngnp(nadzz p0, UInt32 p1, ehloh p2)
at nnaak.nllyd.anoln(String p0, tkeml p1, Boolean p2, ehloh p3)
at Rebex.Net.Sftp.ezyyg(tkeml p0, ehloh p1, String p2, Stream p3, Int64 p4, Int64 p5, emxzq p6)
--- End of inner exception stack trace ---
at Rebex.Net.Sftp.ezyyg(tkeml p0, ehloh p1, String p2, Stream p3, Int64 p4, Int64 p5, emxzq p6)
at Rebex.Net.Sftp.pozjt(Object p0, Enum p1, Object[] p2)
at nnaak.toymy.crbij(Object p0)
--- End of stack trace from previous location where exception was thrown ---
at SftpSendAsync.Application.DomainServices.SftpHelper.SendFiletoSftp(String localFilePath, String remotePath) in /src/SftpSendAsync.Application/DomainServices/SFTPHelper.cs:line 123
at SftpSendAsync.Application.DomainServices.SftpHelper.SendFileToSFTP(String uploadFile, String path, String fileName, CancellationToken cancellationToken) in /src/SftpSendAsync.Application/DomainServices/SFTPHelper.cs:line 103
at SftpSendAsync.Application.Services.ProcessWork.SendFilesToSftp(TemporaryFilesList allFilesToSendList, String ftpPathToSend) in /src/SftpSendAsync.Application/Services/ProcessWork.cs:line 455
at SftpSendAsync.Application.Services.ProcessWork.ProcessWorkItemAsync(WorkItem workItem, AppStepConfiguration stepConfiguration, CancellationToken cancellationToken) in /src/SftpSendAsync.Application/Services/ProcessWork.cs:line 163

Please provide a solution for this asap.

Applies to: Rebex SFTP

1 Answer

0 votes
ago by (136k points)

The error occurred because the SFTP server disconnected the client and sent the "The maximum idle time has been exceeded" message that explains the reason.

So apparently, the SFTP server is configured to disconnect SFTP clients that have been idle for a long time. Possible solutions:

a) Change the server configuration to allow longer idle time.
b) Change the client application's behavior: Instead of keeping SFTP sessions idle when done with whatever they have been used for, disconnect/dispose these SFTP sessions. When there is more work to be done later, establish a new SFTP session.
c) Keep idle SFTP sessions "alive" by periodically performing a simple action such as calling .KeepAlive() or .GetInfo(".", false).
d) Use try/catch to detect this particular error, and establish a new SFTP session when it occurs.

...