Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Giovanni Sidoel 94 posts 233 karma points
    Feb 16, 2016 @ 16:39
    Giovanni Sidoel
    0

    Increase (media) tree timeout?

    Hey guys,

    I'm having an issue with the media section of a site not loading. Now this site has A LOT of media items (thousands if not tens of thousands).

    I have had a similar issue before https://our.umbraco.org/forum/ourumb-dev-forum/bugs/53773-Media-tree-not-loading-all-of-a-sudden

    I get the exact same error

    `[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.] System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction) +1767866 System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction) +5352418 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) +244 System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) +1691 System.Data.SqlClient.SqlDataReader.TryConsumeMetaData() +61 System.Data.SqlClient.SqlDataReader.getMetaData() +90 System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +365 System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds) +1406 System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource1 completion, Int32 timeout, Task& task, Boolean asyncWrite) +177 System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) +53 System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) +134 System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior) +41 System.Data.Common.DbCommand.ExecuteReader(CommandBehavior behavior) +10 StackExchange.Profiling.Data.ProfiledDbCommand.ExecuteDbDataReader(CommandBehavior behavior) +68 System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader() +12 Umbraco.Core.Persistence.<>c__DisplayClass4.b__3() +98 Umbraco.Core.Persistence.FaultHandling.RetryPolicy.ExecuteAction(Func1 func) +170 Umbraco.Core.Persistence.PetaPocoCommandExtensions.ExecuteReaderWithRetry(IDbCommand command, RetryPolicy cmdRetryPolicy, RetryPolicy conRetryPolicy) +118 Umbraco.Core.Persistence.PetaPocoCommandExtensions.ExecuteReaderWithRetry(IDbCommand command, RetryPolicy retryPolicy) +52 Umbraco.Core.Persistence.PetaPocoCommandExtensions.ExecuteReaderWithRetry(IDbCommand command) +48 Umbraco.Core.Persistence.d_1c1.MoveNext() +169 System.Collections.Generic.List1..ctor(IEnumerable1 collection) +381 System.Linq.Enumerable.ToList(IEnumerable1 source) +58 Umbraco.Core.Persistence.Database.Fetch(Func3 cb, Sql sql) +126 Umbraco.Core.Persistence.Repositories.EntityRepository.GetByQuery(IQuery1 query, Guid objectTypeId) +454 Umbraco.Core.Services.EntityService.GetChildren(Int32 parentId, UmbracoObjectTypes umbracoObjectType) +351 umbraco.cms.presentation.Trees.BaseMediaTree.Render(XmlTree& tree) +65 umbraco.loadMedia.Render(XmlTree& tree) +19 umbraco.presentation.webservices.TreeDataService.LoadTree(TreeRequestParams treeParams) +78 umbraco.presentation.webservices.TreeDataService.GetXmlTree() +156 umbraco.presentation.webservices.TreeDataService.ProcessRequest(HttpContext context) +124 System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +341 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +69`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.] System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction) +1767866 System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction) +5352418 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) +244 System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) +1691 System.Data.SqlClient.SqlDataReader.TryConsumeMetaData() +61 System.Data.SqlClient.SqlDataReader.getMetaData() +90 System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +365 System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds) +1406 System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource1 completion, Int32 timeout, Task& task, Boolean asyncWrite) +177 System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) +53 System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) +134 System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior) +41 System.Data.Common.DbCommand.ExecuteReader(CommandBehavior behavior) +10 StackExchange.Profiling.Data.ProfiledDbCommand.ExecuteDbDataReader(CommandBehavior behavior) +68 System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader() +12 Umbraco.Core.Persistence.<>c__DisplayClass4.b__3() +98 Umbraco.Core.Persistence.FaultHandling.RetryPolicy.ExecuteAction(Func1 func) +170 Umbraco.Core.Persistence.PetaPocoCommandExtensions.ExecuteReaderWithRetry(IDbCommand command, RetryPolicy cmdRetryPolicy, RetryPolicy conRetryPolicy) +118 Umbraco.Core.Persistence.PetaPocoCommandExtensions.ExecuteReaderWithRetry(IDbCommand command, RetryPolicy retryPolicy) +52 Umbraco.Core.Persistence.PetaPocoCommandExtensions.ExecuteReaderWithRetry(IDbCommand command) +48 Umbraco.Core.Persistence.d_1c1.MoveNext() +169 System.Collections.Generic.List1..ctor(IEnumerable1 collection) +381 System.Linq.Enumerable.ToList(IEnumerable1 source) +58 Umbraco.Core.Persistence.Database.Fetch(Func3 cb, Sql sql) +126 Umbraco.Core.Persistence.Repositories.EntityRepository.GetByQuery(IQuery1 query, Guid objectTypeId) +454 Umbraco.Core.Services.EntityService.GetChildren(Int32 parentId, UmbracoObjectTypes umbracoObjectType) +351 umbraco.cms.presentation.Trees.BaseMediaTree.Render(XmlTree& tree) +65 umbraco.loadMedia.Render(XmlTree& tree) +19 umbraco.presentation.webservices.TreeDataService.LoadTree(TreeRequestParams treeParams) +78 umbraco.presentation.webservices.TreeDataService.GetXmlTree() +156 umbraco.presentation.webservices.TreeDataService.ProcessRequest(HttpContext context) +124 System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +341 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +69

    Back then, the hosting provider restarted the SQl services and all was well again. This was on a site with much less media items.

    ============ This time I'm on a different environment that we manage almost by ourselves. This error is on umbraco/webservices/TreeDataService.ashx?rnd=f38b5535c81d4096847fd4f88fb48984&id=-1&treeType=media&contextMenu=true&isDialog=false&rnd2=31.8&_=1455636342319 BTW

    It seems to time out after 30 seconds. Is there a way for me to increase this timeout?

    I have tried adding the timeout to the connection string, increasing time-out values in SQL Management studio. No Luck. I Hav also created indexes, made sure the recycle bin was present in the database and empties the recycle bin.

    All other trees work. the media items in the front end work, Just the media tree not loading.

  • Giovanni Sidoel 94 posts 233 karma points
    Feb 17, 2016 @ 18:13
    Giovanni Sidoel
    100

    If any of you run into this issue, here is how I solved it:

    1. Download Umbraco source code from github. Mine was 6.2.5
    2. Open the file src\Umbraco.Core\Persistence\PetaPoco.cs
    3. Find the DoPreExecute(IDbCommand cmd) function
    4. After the if-else if clause add cmd.CommandTimeout = 60; (Essentially doubling the standard 30 secs.)
    5. Build Umbraco.Core
    6. Upload Umbrace.Core.dll to your instance. But remember to make a backup of the old one first!

    Alternatively, if you run 6.2.5, hit me up and I'll send you the dll.

    No idea if this is an optimal solution, but it does get my media section back up, and we can probably work on structuring it better.

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Feb 17, 2016 @ 18:33
    Jan Skovgaard
    0

    Hi Giovanni

    Thanks for sharing your approach and how you did it - In general making custom builds of the core (No matter the version) it should be mentioned that the downside is that those changes will be lost if one suddenly needs to upgrade to a newer version - If the thing one has fixed/made different is not changed in the Umbraco core.

    Just mentioning this so people keep it in mind before deciding whether this is a viable approach in order to solve their issue.

    But since you're using an old version of Umbraco an upgrade is probably not likely I guess in, which case it might be a good approach :)

    /Jan

  • Giovanni Sidoel 94 posts 233 karma points
    Feb 17, 2016 @ 19:14
    Giovanni Sidoel
    0

    Agreed Jan.

  • Mahesh 20 posts 90 karma points
    Jan 07, 2020 @ 11:02
    Mahesh
    0

    Hi Giovanni Sidoel,

    Can you please provide the Umbrace.Core.dll. I am using Umbraco 6.2.5.

  • Giovanni Sidoel 94 posts 233 karma points
    Jan 07, 2020 @ 13:20
Please Sign in or register to post replies

Write your reply to:

Draft