Copied to clipboard

Flag this post as spam?

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


  • Liam Dilley 153 posts 379 karma points
    Jan 04, 2022 @ 02:15
    Liam Dilley
    0

    Hi All,

    Following a disaster with a server been running SQL recovery tool on databases for sites. All have various issues after but recovering but come across this one I can not fix...

    Database restored. Tables and data seem to be there. Site loads so picking up the database. Without debug on it was not finding any of the content nodes in the tree. Tree would show but clicking any got errors.

    In settings the sidebar does not load and you can not run a clear of the database cache as it produces errors and says to look in log but nothing shows.

    Debug on the following error shows:

    An error occurred

    Invalid object name 'cmsMacroProperty'. Exception Details System.Data.SqlClient.SqlException: Invalid object name 'cmsMacroProperty'.

    Stack Trace:

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

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

    at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)

    at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()

    at System.Data.SqlClient.SqlDataReader.get_MetaData()

    at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted)

    at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)

    at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)

    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 Umbraco.Core.Persistence.FaultHandling.RetryPolicy.ExecuteAction[TResult](Func`1 func) in D:\a\1\s\src\Umbraco.Core\Persistence\FaultHandling\RetryPolicy.cs:line 172

    at NPoco.Database.ExecuteReaderHelper(DbCommand cmd)

    at NPoco.Database.ExecuteDataReader(DbCommand cmd)

    at NPoco.Database.

    at System.Collections.Generic.List1..ctor(IEnumerable1 collection)

    at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)

    at NPoco.Database.FetchOneToMany[T](Expression`1 many, Sql sql)

    at Umbraco.Core.Persistence.Repositories.Implement.MacroRepository.GetAllNoIds() in D:\a\1\s\src\Umbraco.Core\Persistence\Repositories\Implement\MacroRepository.cs:line 69

    at Umbraco.Core.Cache.DefaultRepositoryCachePolicy2.GetAll(TId[] ids, Func2 performGetAll) in D:\a\1\s\src\Umbraco.Core\Cache\DefaultRepositoryCachePolicy.cs:line 235

    at Umbraco.Core.Services.Implement.MacroService.GetAll(Int32[] ids) in D:\a\1\s\src\Umbraco.Core\Services\Implement\MacroService.cs:line 51

    at Umbraco.Web.Trees.MacrosTreeController.CreateRootNode(FormDataCollection queryStrings) in D:\a\1\s\src\Umbraco.Web\Trees\MacrosTreeController.cs:line 20

    at Umbraco.Web.Trees.TreeControllerBase.GetRootNode(FormDataCollection queryStrings) in D:\a\1\s\src\Umbraco.Web\Trees\TreeControllerBase.cs:line 95

    at Umbraco.Web.Trees.ApplicationTreeController.

    --- End of stack trace from previous location where exception was thrown ---

    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

    at Umbraco.Web.Trees.ApplicationTreeController.

    --- End of stack trace from previous location where exception was thrown ---

    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

    at Umbraco.Web.Trees.ApplicationTreeController.

    --- End of stack trace from previous location where exception was thrown ---

    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

    at System.Threading.Tasks.TaskHelpersExtensions.

    --- End of stack trace from previous location where exception was thrown ---

    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

    at System.Web.Http.Controllers.ApiControllerActionInvoker.

    --- End of stack trace from previous location where exception was thrown ---

    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

    at System.Web.Http.Filters.ActionFilterAttribute.

    --- End of stack trace from previous location where exception was thrown ---

    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

    at System.Web.Http.Filters.ActionFilterAttribute.

    --- End of stack trace from previous location where exception was thrown ---

    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

    at System.Web.Http.Filters.ActionFilterAttribute.

    --- End of stack trace from previous location where exception was thrown ---

    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

    at System.Web.Http.Filters.ActionFilterAttribute.

    --- End of stack trace from previous location where exception was thrown ---

    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

    at System.Web.Http.Filters.ActionFilterAttribute.

    --- End of stack trace from previous location where exception was thrown ---

    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

    at System.Web.Http.Filters.ActionFilterAttribute.

    --- End of stack trace from previous location where exception was thrown ---

    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

    at System.Web.Http.Filters.ActionFilterAttribute.

    --- End of stack trace from previous location where exception was thrown ---

    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

    at System.Web.Http.Filters.ActionFilterAttribute.

    --- End of stack trace from previous location where exception was thrown ---

    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

    at System.Web.Http.Filters.ActionFilterAttribute.

    --- End of stack trace from previous location where exception was thrown ---

    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

    at System.Web.Http.Filters.ActionFilterAttribute.

    --- End of stack trace from previous location where exception was thrown ---

    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

    at System.Web.Http.Filters.ActionFilterAttribute.

    --- End of stack trace from previous location where exception was thrown ---

    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

    at System.Web.Http.Filters.ActionFilterAttribute.

    --- End of stack trace from previous location where exception was thrown ---

    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

    at System.Web.Http.Controllers.ActionFilterResult.

    --- End of stack trace from previous location where exception was thrown ---

    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

    at System.Web.Http.Filters.AuthorizationFilterAttribute.

    --- End of stack trace from previous location where exception was thrown ---

    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

    at System.Web.Http.Filters.AuthorizationFilterAttribute.

    --- End of stack trace from previous location where exception was thrown ---

    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

    at System.Web.Http.Filters.AuthorizationFilterAttribute.

    --- End of stack trace from previous location where exception was thrown ---

    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

    at System.Web.Http.Controllers.ExceptionFilterResult.

    --- End of stack trace from previous location where exception was thrown ---

    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

    at System.Web.Http.Controllers.ExceptionFilterResult.

    --- End of stack trace from previous location where exception was thrown ---

    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

    at System.Web.Http.Dispatcher.HttpControllerDispatcher.


    I spent time googling and I have been reading on the schema stuff and all the database tables have it as dbo. User is correct. Comparing it to ones that work as well as a fresh install version of 8 it appears to have the same permissions etc. As I mentioned things minus a load of content and macros load but something is up.

    A Macro on the home page throws an error:

    ystem.Data.SqlClient.SqlException (0x80131904): Invalid object name 'cmsMacroProperty'. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)

    Anyone have any ideas?

  • Liam Dilley 153 posts 379 karma points
    Jan 04, 2022 @ 02:19
    Liam Dilley
    0

    I also wanted to add that it MAY be the database cache vs restored database? But the back office option to run it does not work. Is there any other way to clear to see if that is the issue?

    When you run that in debug mode you get:

    An error occurred
    
    Invalid object name 'umbracoContentVersionCultureVariation'.
    Exception Details
    System.Data.SqlClient.SqlException: Invalid object name 'umbracoContentVersionCultureVariation'. 
    
  • Liam Dilley 153 posts 379 karma points
    Jan 04, 2022 @ 02:53
    Liam Dilley
    100

    I think I fixed the issues myself for anyone coming across this and finding the other forum posts with similar errors do not work.

    If you have had to restore or recover database and its not the schema issues it may be that foriegn keys are not existing on some data tables.

    The solution is to installed the Umbraco version as a new site and database. Through the SQL manager or SQL queries (which ever you are happy with) and copy those tables from the new one over to your site to restore. Be mindful if they are anything like content ones but hopefully it's just like the Macro or Culture system ones like me.

    Once you have those errors not showing up and if you can get to the settings and database cache rebuild - run that. This should address any other issues you have.

    If you get any items with a "same key" error go to the document type of the item and save and clear the database cache again. It should address those as well.

Please Sign in or register to post replies

Write your reply to:

Draft