problemi che sto vivendo con un servizio che si connette a un'istanza remota di SQL Server 2012.SQL Server 2012 Connessione remota dando Timeout e ASYNC_NETWORK_IO errori
Il servizio NET 2.0 viene eseguito sulla macchina client e si connette utilizzando il protocollo TCP/IP a un server Web remoto che attualmente esegue un'istanza di SQL Server 2012. Il server Web era Windows Server 2003 e SQL Server 2005 ed è stato aggiornato 6 mesi fa senza problemi. Il servizio controlla quindi se ci sono dati che è necessario scaricare.
client macchina
- Windows Server 2003
Web Server
- di Windows Server 2012
- SQL Server 2012
Questo correva bene per 5+ anni fino Venerdì scorso, quando improvvisamente smesso di funzionare e dà il messaggio di log seguente errore
Event Type: Warning
Event Source:
Event Category: None
Event ID: 0
Date: 21/05/2013
Time: 16:45:11
User: N/A
Computer:
Description:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Data.SqlClient.SqlException: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParserStateObject.ReadSniError(TdsParserStateObject stateObj, UInt32 error)
at System.Data.SqlClient.TdsParserStateObject.ReadSni(DbAsyncResult asyncResult, TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParserStateObject.ReadNetworkPacket()
at System.Data.SqlClient.TdsParserStateObject.ReadByteArray(Byte[] buff, Int32 offset, Int32 len)
at System.Data.SqlClient.TdsParserStateObject.ReadUInt32()
at System.Data.SqlClient.TdsParser.ReadSqlValueInternal(SqlBuffer value, Byte tdsType, Int32 typeId, Int32 length, TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.ReadSqlValue(SqlBuffer value, SqlMetaDataPriv md, Int32 length, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlDataReader.ReadColumnData()
at System.Data.SqlClient.SqlDataReader.ReadColumnHeader(Int32 i)
at System.Data.SqlClient.SqlDataReader.ReadColumn(Int32 i, Boolean setTimeout)
at System.Data.SqlClient.SqlDataReader.GetValueInternal(Int32 i)
at System.Data.SqlClient.SqlDataReader.GetValue(Int32 i)
at RedBlack.Data.Synchronisation.SyncManager.UpsertRecords(String sourceSelect, String destTable, String[] destFields, List`1 relations)
at General.CyPro.Application.WebSynchronisation.SyncRoutines.FetchOrders(UpsertFlags upsertOptions)
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
at System.Delegate.DynamicInvokeImpl(Object[] args)
at RedBlack.CyPro.Application.WebSynchronisation.Job.Run(Object[] args)
...
System.Data.SqlClient.SqlException: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParserStateObject.ReadSniError(TdsParserStateObject stateObj, UInt32 error)
at System.Data.SqlClient.TdsParserStateObject.ReadSni(DbAsyncResult asyncResult, TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParserStateObject.ReadNetworkPacket()
at System.Data.SqlClient.TdsParserStateObject.ReadByteArray(Byte[] buff, Int32 offset, Int32 len)
at System.Data.SqlClient.TdsParserStateObject.ReadUInt32()
at System.Data.SqlClient.TdsParser.ReadSqlValueInternal(SqlBuffer value, Byte tdsType, Int32 typeId, Int32 length, TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.ReadSqlValue(SqlBuffer value, SqlMetaDataPriv md, Int32 length, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlDataReader.ReadColumnData()
at System.Data.SqlClient.SqlDataReader.ReadColumnHeader(Int32 i)
at System.Data.SqlClient.SqlDataReader.ReadColumn(Int32 i, Boolean setTimeout)
at System.Data.SqlClient.SqlDataReader.GetValueInternal(Int32 i)
at System.Data.SqlClient.SqlDataReader.GetValue(Int32 i)
at RedBlack.Data.Synchronisation.SyncManager.UpsertRecords(String sourceSelect, String destTable, String[] destFields, List`1 relations)
at General.CyPro.Application.WebSynchronisation.SyncRoutines.FetchOrders(UpsertFlags upsertOptions)
Ho controllato il monitor attività sul server web e quando si esegue la query è sospeso con WAIT_TYPE di ASYNC_NETWORK_IO.
Ho eseguito la query che si sta cercando di eseguire manualmente in Management Studio sul server client la connessione remota a l'istanza del server web e funziona per circa 40 secondi di ritorno 2600+ righe prima che mi dà il seguente errore
Msg 121, Level 20, State 0, Line 0
A transport-level error has occurred when receiving results from the server. (provider: TCP Provider, error: 0 - The semaphore timeout period has expired.)
Ho eseguito la stessa query sul mio computer in Management Studio connettendo in remoto all'istanza del server Web e restituisce le 4000 righe complete in 0,312 secondi.
Sono in perdita cercando di capirlo come mi sembra essere una sorta di problema di rete. I tecnici dell'hardware dei clienti hanno controllato la rete e hanno detto che per loro tutto va bene.
Se avete bisogno di ulteriori informazioni fammi sapere
Grazie
Questo ha risolto gli errori di timeout ma non il problema sottostante, i messaggi del registro errori sono stati modificati in "Si è verificato un errore a livello di trasporto durante la ricezione dei risultati dal server. (provider: Provider TCP, errore: 0 - Il periodo di timeout del semaforo è scaduto.) 'piuttosto che l'errore di timeout. Il client ha internet lento ma ha avuto la stessa velocità di connessione per 6 anni, stanno ottenendo il loro fornitore di banda larga per controllare la connessione al momento. – Croberts
Hai controllato le modifiche apportate al server web poco prima di questo? Può essere una patch o un aggiornamento, o un cambiamento di impostazioni? O forse il tuo cliente è stato aggiornato/modificato? – Stoleg
Timeout del semaforo - è un timeout di livello inferiore - può essere a livello di rete o di file system. Puoi eseguire 'DBCC CHECKTABLE MyTable' per vedere se la tua tabella è ok, ma sinse puoi eseguire script fine dal tuo computer, il problema è al di fuori del tuo database. – Stoleg