U4-623 - Saving Doc Types - SqlException (0x80131904): Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.

Created by Sebastiaan Janssen 19 Aug 2012, 14:55:04 Updated by Umbraco 07 Nov 2016, 13:55:56

Is duplicated by: U4-276

Relates to: COU-261

Relates to: U4-7869

Just got another SQL Timeout which is now becoming a regular occurrence. Scenario is adding a property to a homepage document type (very large multi site installation with lot of properties).

Upon clicking save, after a short time, the following error is displayed. This was also raised by others in workitem http://umbraco.codeplex.com/workitem/23075 but someone closed it off.

Simon

Server Error in '/' Application.

Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[SqlException (0x80131904): Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.] System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +2062238 System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +5050268 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning() +234 System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2275 System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +215 System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) +987 System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +162 System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) +178 System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +137 Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteNonQuery(SqlConnection connection, CommandType commandType, String commandText, SqlParameter[] commandParameters) +56 Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteNonQuery(String connectionString, CommandType commandType, String commandText, SqlParameter[] commandParameters) +83 umbraco.DataLayer.SqlHelpers.SqlServer.SqlServerHelper.ExecuteNonQuery(String commandText, SqlParameter[] parameters) +21 umbraco.DataLayer.SqlHelper`1.ExecuteNonQuery(String commandText, IParameter[] parameters) +85

[SqlHelperException: Umbraco Exception (DataLayer): SQL helper exception in ExecuteNonQuery] umbraco.DataLayer.SqlHelper`1.ExecuteNonQuery(String commandText, IParameter[] parameters) +140 umbraco.cms.businesslogic.ContentType.populatePropertyData(PropertyType pt, Int32 contentTypeId) +134 umbraco.cms.businesslogic.ContentType.populateMasterContentTypes(PropertyType pt, Int32 docTypeId) +127 umbraco.cms.businesslogic.ContentType.AddPropertyType(DataTypeDefinition dt, String Alias, String Name) +50 umbraco.controls.ContentTypeControlNew.saveProperties(SaveClickEventArgs& e) +360 umbraco.controls.ContentTypeControlNew.save_click(Object sender, ImageClickEventArgs e) +236 System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs e) +115 System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument) +120 System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5563

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272

''Originally created on CodePlex by [SimonAntony|http://www.codeplex.com/site/users/view/SimonAntony]'' on 7/25/2012 12:45:40 PM [Codeplex ID: 30940 - Codeplex Votes: 5]

Imported comments

''Comment by [SimonAntony|http://www.codeplex.com/site/users/view/SimonAntony] on 7/25/2012 1:10:37 PM:'' Original workitem http://umbraco.codeplex.com/workitem/23075

''Comment by [codegecko|http://www.codeplex.com/site/users/view/codegecko] on 7/25/2012 2:11:28 PM:'' Not quite original, but still worthy of investigation. Thanks Simon, I'll take a look.

''Comment by [awaegel|http://www.codeplex.com/site/users/view/awaegel] on 8/13/2012 8:45:40 PM:'' Discussion of this issue on Our: http://our.umbraco.org/forum/using/ui-questions/27003-SQL-timing-out-when-adding-a-new-property-to-a-doctype?p=0#comment124140

''Comment by [dan_bramall|http://www.codeplex.com/site/users/view/dan_bramall] on 8/14/2012 3:50:36 PM:'' I can report that the fix on the forums (http://our.umbraco.org/forum/using/ui-questions/27003-SQL-timing-out-when-adding-a-new-property-to-a-doctype#comment121171), setting the command timeout explicitly (scm.CommandTimeout = 600) worked for me in resolving this. I've no idea of any consequences with this change but it's hopefully a start.

Comments

Simon Steed 19 Sep 2012, 09:57:33

It seems to have also resolved it for me as well in 4.9 with that patch applied


Simon Steed 03 Nov 2012, 13:22:10

To confirm i've been running the patch Dan mentioned in his last post since late August / early sept on a large live site and it's 100% resolved the problems - if you want, i'll submit a patch although could be redundant now as I fixed it in 4.9 codebase!


Sebastiaan Janssen 06 Nov 2012, 16:58:13

@Simon great, a patch would be much appreciated (make sure to update the Fix Submitted field when you do so). Thanks!


Andrew Waegel 13 Feb 2013, 05:09:36

Just ran into this issue again. Checking the source for Umbraco 6.0, it looks like this problem still hasn't been resolved, unless I'm missing something - it's still using SqlHelper, but maybe that's been updated to use a longer timeout?


Chester Campbell Jr 14 Aug 2014, 17:46:17

I'm getting this error with Umbraco 7.1.4 when trying to delete a property on a doc type. This particular doc type has about 30,000 content nodes created with it. Here's the stack trace:

[Win32Exception (0x80004005): The wait operation timed out]

[SqlException (0x80131904): Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. The statement has been terminated.] System.Runtime.Remoting.Proxies.RealProxy.EndInvokeHelper(Message reqMsg, Boolean bProxyCase) +508 System.Runtime.Remoting.Proxies.RemotingProxy.Invoke(Object NotUsed, MessageData& msgData) +401 System.Action`1.EndInvoke(IAsyncResult result) +0 System.Web.UI.d__3.MoveNext() +603 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +144 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +84 System.Web.UI.d__0.MoveNext() +507 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +144 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +84 System.Web.UI.d__2c.MoveNext() +1145


Carl Bussema 01 Jun 2016, 14:07:57

I'm running into this trying to use ContentService.GetContentOfType(int id) so it's still a very real and very frustrating problem. I may wind up having to hard code SQL in for this since it's a limited operation, but still, that they can't just expose a web.config setting DefaultSQLTimeout and whenever they go to execute a query, if that query isn't already defined with a special setting that's higher, use the setting you provide... this should not be hard.


Priority: Major

Type: Bug

State: Closed

Assignee:

Difficulty: Normal

Category:

Backwards Compatible: True

Fix Submitted: Inline code

Affected versions:

Due in version:

Sprint:

Story Points:

Cycle: