0

We've installed active directory on a new server and joined our database server and web servers to this new domain. However, randomly, we'll get the following error. What would be the cause of the handshake timeout error we're sometimes seeing?

The fact that it's not ALWAYS happening to me means that the connection string information is probably correct (or close to it). Below is the connection string we're using and the error we are SOMETIMES seeing:

Connection string:

Data Source=<IP Address>;Initial Catalog=<DB Name>;Integrated Security=SSPI

Stacktrace:

System.Data.SqlClient.SqlException (0x80131904): Connection Timeout Expired.  The timeout period elapsed while attempting to consume the pre-login handshake acknowledgement.  This could be because the pre-login handshake failed or the server was unable to respond back in time.  The duration spent while attempting to connect to this server was - [Pre-Login] initialization=15610; handshake=0;  ---> System.ComponentModel.Win32Exception (0x80004005): The wait operation timed out

at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)

   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)

   at System.Data.SqlClient.TdsParserStateObject.ReadSniError(TdsParserStateObject stateObj, UInt32 error)

   at System.Data.SqlClient.TdsParserStateObject.ReadSniSyncOverAsync()

   at System.Data.SqlClient.TdsParserStateObject.TryReadNetworkPacket()

   at System.Data.SqlClient.TdsParser.ConsumePreLoginHandshake(Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, Boolean& marsCapable)

   at System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, Boolean withFailover)

   at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, Boolean withFailover)

   at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString connectionOptions, SqlCredential credential, TimeoutTimer timeout)

   at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(TimeoutTimer timeout, SqlConnectionString connectionOptions, SqlCredential credential, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance)

   at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData)

   at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)
2
  • What exactly is your question? There are a couple of different ones I could see as possibilities from your post. – squillman Oct 9 '14 at 14:48
  • I'm wondering what would be the cause of the handshake failure – Adam Levitt Oct 9 '14 at 14:53
0

This is most likely a timeout due to some network issue. What the cause of the network issue is impossible to state given the information. It could be anything in between the client and the SQL Server instance. Client or server resource issues, problematic IP settings, errors with a NIC, network congestion or latency, etc. I know the errors are not reliably reproducable but if you can get a network trace when one of the exceptions happens it can help point you in the right direction and you can begin to narrow things down from there.

2
  • Thanks for the assistance. What sort of technique would you recommend to do a network trace? – Adam Levitt Oct 9 '14 at 15:37
  • 2
    Packet capture / analyzer. If you don't have one or you can't get help from your network infrastructure team, Wireshark is the way to go. – squillman Oct 9 '14 at 15:40
0

Step 1:

netsh trace start capture=yes

Step 2: Open in Microsoft Message Analyzer

Step 3: Profit

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.