0

I keep getting "System.Data.SqlClient.SqlException: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding." 9 out of 10 times when I try to see workflow history. here is what I got from the SP log. I binged the error but not finding any resolution. Spent 6 hours trying to find a solution or looking at SQL log but not finding anything that stands out. I want to find out if anyone else has encounter this before and what is the fix.

// Error

Error establishing database connection. SQL Error: -2.: 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.SqlConnection.OnError(SqlException exception, Boolean breakConnection)    
 at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)    
 at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)    
 at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()    
 at System.Data.SqlClient.SqlDataReader.get_MetaData()    
 at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)    
 at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)    
 at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)    
 at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)    
 at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)    
 at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior)    
1
  • I would start by checking the lag time. Is the SP farm and the SQL Server in the same data center? ping from a SP server to the SQL server, for a duration of 10 minutes (ping SERVER -n 600). Make sure the intra-farm latency is < 1ms. Next, is this a custom code you have created? Do you have a dedicated SQL Server for your SP DBs? Is your custom code calling an LOB DB? Maybe other LOB applications are competing for resources on that SQL Server? I don't recommend you change the timeout settings as this will effect other operations in your SP farm. You have find out what is causing the timeout.
    – Hossein A
    Commented Dec 30, 2013 at 21:25

2 Answers 2

1

Are you only receiving this timeout error in one particular webapp/site collection/subsite/list workflow history or does this seem to happen intermittently and not specific to any one item? Look over the suggestions provided here: http://blogs.technet.com/b/wbaer/archive/2009/10/06/intermittent-database-server-connectivity-and-microsoft-sharepoint-products-and-technologies.aspx. We increased our timeout to 45 seconds per that article, which makes a change to the server's dsn (HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\14.0\Secure\configdb\DSN)

1

It seems you are putting a heavy load on the server and that cannot be handled by the SQL Server itself. I would suggest splitting it into chunks, executing one by one and also increase the timeout to something relatively better for the particular query.

I think it is ok to increase timeout upto 90 seconds depending on the situation and then can rollback after its done or specify timeout to the specific command.

Also keep a track of timing and plan the future as you may experience the same in future with the solution getting much complicated and heavy with data.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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