Copied to clipboard

Flag this post as spam?

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

  • Jamie Connolly 17 posts 74 karma points
    Aug 14, 2015 @ 15:23
    Jamie Connolly

    Cannot load node - The wait operation timed out


    I hope someone can help with this issue.

    I am getting an error in the CMS when I attempt to load a node that I have added an image to. The error happens after I do the following:

    1. Open a node
    2. Add an image to any RTE via the media button
    3. Save or Publish the node.
    4. Error occurs

    The error I get back is as follows:

    The wait operation timed out
    [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, Action`1 wrapCloseInAction) +1767866
       System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 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.get_MetaData() +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, TaskCompletionSource`1 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.<ExecuteReaderWithRetry>b__3() +98
       Umbraco.Core.Persistence.FaultHandling.RetryPolicy.ExecuteAction(Func`1 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.<Query>d__1c`1.MoveNext() +169
       System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) +381
       System.Linq.Enumerable.ToList(IEnumerable`1 source) +58
       Umbraco.Core.Persistence.Database.Fetch(Sql sql) +117
       Umbraco.Core.Services.MediaService.GetMediaByPath(String mediaPath) +1274
       umbraco.editorControls.tinyMCE3.webcontrol.TinyMCEWebControl.FormatMedia(String html) +921
       umbraco.editorControls.tinyMCE3.webcontrol.TinyMCEWebControl.OnPreRender(EventArgs e) +35
       System.Web.UI.Control.PreRenderRecursiveInternal() +83
       System.Web.UI.Control.PreRenderRecursiveInternal() +155
       System.Web.UI.Control.PreRenderRecursiveInternal() +155
       System.Web.UI.Control.PreRenderRecursiveInternal() +155
       System.Web.UI.Control.PreRenderRecursiveInternal() +155
       System.Web.UI.Control.PreRenderRecursiveInternal() +155

    I can see that the issue appears to be coming from the tinyMCE3 function FormatMedia, but I don't know why it has started happening.

    I found a few similar posts mentioning it could be a database size problem, but the database is 5GB, which is one of our biggest, however I have seen larger databases using Umbraco, so not sure if this could be the cause.

    I have tried loading different images, as well testing on other pages but all receive the same error on publish and when loaded directly from the tree menu.

    I have also tested the media items in some media picker controls and all work fine.

    The problem only seems to be when it loads the FormatMedia function in TinyMCE.

    Any help would be appreciated.

  • Chris Roberts 74 posts 106 karma points c-trib
    Apr 25, 2016 @ 10:06
    Chris Roberts

    Hi Jamie,

    I'm seeing exactly this behaviour in one of our production sites. Did you ever get to the bottom of it?

    We're running Umbraco v6.2.6

    Thanks, Chris

  • Jamie Connolly 17 posts 74 karma points
    Apr 25, 2016 @ 11:22
    Jamie Connolly

    Hi Chris

    Yes, the issue I had was related directly to the number of versions (the version for the Rollback feature) I had in my database. My project imports a large number of items on an hourly basis that creates or updates equivalent nodes in the content section. After a few weeks the website was filled with old versions and taking a lot of time to pull information from the database when in the CMS.

    If this is something similar to what you are doing I found a quick fix and a workaround.

    The quickfix is to trigger a stored procedure to remove the extra versions, you can get it from this link (it was too big for the page). The reason this is limited to 10000 rows at a time is to do with the size of the log files. The files were becoming too large when processing large amounts of rows, so the limit is there to solve that small issue. The Nodes table contains only an int 'id' column and the Versions table contains a uniqueidentifier 'id' column. This method will remove all old version from ALL nodes in the database. You could change the stored procedure to make it work on only specific nodes types if you wanted to.

    If you are updating a lot of nodes which are creating these versions like I was, you can use the DeleteVersions(int id, DateTime versionDate, [int userId = 0]) function which will delete the version for a specific node. When creating or updating my nodes I use this like so:

    var contentService = Services.ContentService;
    var pubItem = contentService.GetById([YOURID]);
    // Do what you need to do to the node
    contentService.SaveAndPublish(pubItem, 0);
    contentService.DeleteVersions(pubItem.Id, DateTime.Now.AddMinutes(-5));

    That should get rid of any extra versions on specific document types.

    With those two items done your database should be shrunk back down to a reasonable limit and the pages should start reloading.

    An additional option is to also limit the log files of the database, as the log files themselves can become quite large, which was also causing me some issues.

    I'm not sure of the differences between v6.2.6 and v6.1.6 which I am using, may be worth looking at the field names in the stored procedure before continuing.

    I hope that helps. Jamie

  • Richard Read 16 posts 47 karma points c-trib
    Jul 25, 2018 @ 09:08
    Richard Read


    Has anyone found a solution to this? I'm experiencing the same issue when browsing a node that uses TinyMCE with an image in Umbraco 6.2.5 - but keep getting the 'Wait Operation' timeout error.

    Steps I've taken to resolve are:

    • Run a SQL script to remove all old or unused versions of content and preview xml from the database
    • Rebuilt all indexes on the database
    • Increased the sizing of the database (using SQL Azure).

    Any suggestions would be appreciated.

    Kind regards, Rick

Please Sign in or register to post replies

Write your reply to: