sshnet / sshnet/SSH.NET

Socket read operation has timed out after 30000 milliseconds - after several successful connections

Aperta
#642 0 commenti 1 reazione 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Lingua principale
C#
Stelle
4.4k
Fork
993
Merge medio
9g 21h
PR unite (30g)
1

Descrizione

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()

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia con lo stack trace segnalato attraverso Renci.SshNet.Abstractions.SocketAbstraction.Read, Session.Connect e BaseClient.Connect, quindi esamina la sequenza di connessioni ripetute di OptimoKurierService.Jobs.MainJob. Riproduci le connessioni riuscite seguite da timeout e confronta il comportamento della libreria con il server SFTP e le condizioni di rete. Il lavoro è completato quando viene determinato se il timeout è un difetto della libreria o un problema di connessione esterno.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
csharp
Ambito
networking
Tipo di issue
Bug
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
15/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.