Socket read operation has timed out after 30000 milliseconds - after several successful connections
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 4.4k
- Forks
- 993
- Avg merge
- 9d 21h
- Merged PRs (30d)
- 1
Description
Hi!
I have a different issue then similiar ones. After serveral successful connection I'm getting an error as in the title.
It's a Windows Service that checks documents status on a SFTP server. And, yes, it is a proper SFTP (SSH) server. I think it's an ISP issue on server side that adds all IPs to blacklist, but I have to make sure that this is not a bug...
My application connects to SFTP server every 5 minutes. Tried on 3 different machines with different IPs, everything ends with the same error after couple successful ones.
Scheduler is Quartz.
2020-03-13 16:05:00.8389|INFO|CONNECTED
2020-03-13 16:10:00.7614|INFO|CONNECTED
2020-03-13 16:15:00.8870|INFO|CONNECTED
2020-03-13 16:20:00.9344|INFO|CONNECTED
2020-03-13 16:25:00.7007|INFO|CONNECTED
2020-03-13 16:30:00.7013|INFO|CONNECTED
2020-03-13 16:35:00.7175|INFO|CONNECTED
2020-03-13 16:40:00.7181|INFO|CONNECTED
2020-03-13 16:45:00.7187|INFO|CONNECTED
2020-03-13 16:50:00.7037|INFO|CONNECTED
2020-03-13 16:55:00.6886|INFO|CONNECTED
2020-03-13 17:00:00.7517|INFO|CONNECTED
2020-03-13 17:05:00.6898|INFO|CONNECTED
2020-03-13 17:10:00.7061|INFO|CONNECTED
2020-03-13 17:15:00.6754|INFO|CONNECTED
2020-03-13 17:20:00.7854|INFO|CONNECTED
2020-03-13 17:25:00.6922|INFO|CONNECTED
2020-03-13 17:30:00.6928|INFO|CONNECTED
2020-03-13 17:35:00.6934|INFO|CONNECTED
2020-03-13 17:40:00.6940|INFO|CONNECTED
2020-03-13 17:45:30.5072|ERROR|Renci.SshNet.Common.SshOperationTimeoutException: Socket read operation has timed out after 30000 milliseconds.
w Renci.SshNet.Abstractions.SocketAbstraction.Read(Socket socket, Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout)
w Renci.SshNet.Session.SocketReadLine(TimeSpan timeout)
w Renci.SshNet.Session.Connect()
w Renci.SshNet.BaseClient.Connect()
w OptimoKurierService.Jobs.MainJob.<Execute>d__0.MoveNext()
2020-03-13 17:50:30.5078|ERROR|Renci.SshNet.Common.SshOperationTimeoutException: Socket read operation has timed out after 30000 milliseconds.
w Renci.SshNet.Abstractions.SocketAbstraction.Read(Socket socket, Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout)
w Renci.SshNet.Session.SocketReadLine(TimeSpan timeout)
w Renci.SshNet.Session.Connect()
w Renci.SshNet.BaseClient.Connect()
w OptimoKurierService.Jobs.MainJob.<Execute>d__0.MoveNext()
2020-03-13 17:55:30.5240|ERROR|Renci.SshNet.Common.SshOperationTimeoutException: Socket read operation has timed out after 30000 milliseconds.
w Renci.SshNet.Abstractions.SocketAbstraction.Read(Socket socket, Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout)
w Renci.SshNet.Session.SocketReadLine(TimeSpan timeout)
w Renci.SshNet.Session.Connect()
w Renci.SshNet.BaseClient.Connect()
w OptimoKurierService.Jobs.MainJob.<Execute>d__0.MoveNext()
2020-03-13 18:00:30.5246|ERROR|Renci.SshNet.Common.SshOperationTimeoutException: Socket read operation has timed out after 30000 milliseconds.
w Renci.SshNet.Abstractions.SocketAbstraction.Read(Socket socket, Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout)
w Renci.SshNet.Session.SocketReadLine(TimeSpan timeout)
w Renci.SshNet.Session.Connect()
w Renci.SshNet.BaseClient.Connect()
w OptimoKurierService.Jobs.MainJob.<Execute>d__0.MoveNext()
2020-03-13 18:05:30.5096|ERROR|Renci.SshNet.Common.SshOperationTimeoutException: Socket read operation has timed out after 30000 milliseconds.
w Renci.SshNet.Abstractions.SocketAbstraction.Read(Socket socket, Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout)
w Renci.SshNet.Session.SocketReadLine(TimeSpan timeout)
w Renci.SshNet.Session.Connect()
w Renci.SshNet.BaseClient.Connect()
w OptimoKurierService.Jobs.MainJob.<Execute>d__0.MoveNext()
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the reported stack trace through Renci.SshNet.Abstractions.SocketAbstraction.Read, Session.Connect, and BaseClient.Connect, then review the repeated connection sequence from OptimoKurierService.Jobs.MainJob. Reproduce the successful connections followed by timeouts and compare the library behavior with the SFTP server and network conditions. Done means determining whether the timeout is a library defect or an external connection issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 15/100