Rebuilding Core’s Link Database on Sitecore 9.0 Update 1 generates lots of errors

When rebuilding the Link Database for the Core database on Sitecore 9.0 Update 1 (XP0 configuration), I received 630 errors!

The Link Database rebuild continues, and appears to complete successfully. I didn’t see any problems arising from this, but 630 errors is quite a lot.

I was also able to replicate this on several different development systems for different customers. I even set up a new, unmodified Sitecore 9.0 Update 1 – XP0 instance locally, and replicated the problem. Each system shows 630 errors per Core’s Link Database rebuild. Rebuilding Master or Web databases does not cause this error.

It appears that the issue is to do with deserialising the layout field’s XML during Links Database rebuild. It seems some items must have a layout that is “:”.

I raised this with Sitecore and got a very quick response.

It’s a known issue, apparently with the Final Renderings field, and the work around is:

  • Backup your CORE database.
  • Run the following SQL to get the field records with errors:

SELECT * FROM [Your Core Db Name].[dbo].[VersionedFields] where [FieldId]='{04BF00DB-F5FB-41F7-8AB7-22408372A981}' and [Value]=':'

  • (Mine returned 630 records.)
  • Run the following SQL to delete the fields with errors:

DELETE FROM [Your Core Db Name].[dbo].[VersionedFields] where [FieldId]='{04BF00DB-F5FB-41F7-8AB7-22408372A981}' and [Value]=':'

  • Rebuild the core database to check it works.

I’ve done this, and it seems to stop the errors. I’ve not get verified that is doesn’t cause any other issues, though my gut tells me that this should be find.

The errors in the logs were of the form:

ManagedPoolThread #1 09:14:33 ERROR Attempted to load invalid xml.
Exception: System.Xml.XmlException
Message: Data at the root level is invalid. Line 1, position 1.
Source: System.Xml
at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespace()
at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace)
at System.Xml.XmlDocument.Load(XmlReader reader)
at System.Xml.XmlDocument.LoadXml(String xml)
at Sitecore.Xml.XmlUtil.LoadXml(String xml)

ManagedPoolThread #1 09:14:33 ERROR First 200 characters: :
ManagedPoolThread #1 09:14:33 ERROR Call stack: at Sitecore.MainUtil.GetCallStack()
at Sitecore.Xml.XmlUtil.LoadXml(String xml)
at Sitecore.Data.Fields.LayoutField..ctor(Field innerField)
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Sitecore.Reflection.ReflectionUtil.CreateObject(Type type, Object[] parameters)
at Sitecore.Data.Fields.FieldType.GetField(Field field)
at Sitecore.Data.Fields.DefaultFieldTypeManager.GetField(Field field, String runtimeValue)
at Sitecore.Links.ItemLinks.AddLinks(Field field, List`1 links, ItemLinkState linkState)
at Sitecore.Links.ItemLinks.GetLinks(ItemLinkState linkState, Boolean allVersions, Boolean includeStandardValuesLinks)
at Sitecore.Links.ItemLinks.GetAllLinks(Boolean allVersions)
at Sitecore.Links.LinkDatabase.UpdateReferences(Item item)
at Sitecore.Links.LinkDatabase.RebuildItem(Item item)
at Sitecore.Links.LinkDatabase.RebuildItem(Item item)
at Sitecore.Links.LinkDatabase.RebuildItem(Item item)
at Sitecore.Links.LinkDatabase.RebuildItem(Item item)
at Sitecore.Links.LinkDatabase.Rebuild(Database database)
at Sitecore.Shell.Applications.Dialogs.RebuildLinkDatabase.RebuildLinkDatabaseForm.Builder.Build()
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Sitecore.Reflection.ReflectionUtil.InvokeMethod(MethodInfo method, Object[] parameters, Object obj)
at Sitecore.Jobs.JobRunner.RunMethod(JobArgs args)
at (Object , Object[] )
at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args)
at Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain)
at Sitecore.Jobs.Job.DoExecute()
at Sitecore.Jobs.Job.ThreadEntry(Object state)
at Sitecore.Threading.ManagedThreadPool.ProcessQueuedItems()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()

Hope that helps

Advertisements
Rebuilding Core’s Link Database on Sitecore 9.0 Update 1 generates lots of errors

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.