Sitecore - root element not defined

When trying to deploy with TDS, I encountered the following error. I do not think there are any kind of custom indexes. I looked at the following link and emptied the \ Data \ Indexes folder.

Sitecore index error - root element not defined

What can cause this error?

Also this is url. I get an error: http://<hostname>/sitecore

Full stack trace:

 [InvalidOperationException: Root item is not defined] Sitecore.Diagnostics.Assert.IsNotNull(Object value, String message) +59 Sitecore.Search.Crawlers.DatabaseCrawler.Initialize(Index index) +106 Sitecore.Search.Index.AddCrawler(ICrawler crawler) +36 [TargetInvocationException: Exception has been thrown by the target of an invocation.] System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) +0 System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) +1255 System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +38 Sitecore.Reflection.ReflectionUtil.InvokeMethod(MethodInfo method, Object[] parameters, Object obj) +91 Sitecore.Configuration.Factory.AssignProperties(Object obj, Object[] properties) +760 Sitecore.Configuration.Factory.AssignProperties(XmlNode configNode, String[] parameters, Object obj, Boolean assert, Boolean deferred, IFactoryHelper helper) +943 Sitecore.Configuration.Factory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper) +305 Sitecore.Configuration.Factory.GetInnerObject(XmlNode paramNode, String[] parameters, Boolean assert) +858 Sitecore.Configuration.Factory.AssignProperties(XmlNode configNode, String[] parameters, Object obj, Boolean assert, Boolean deferred, IFactoryHelper helper) +795 Sitecore.Configuration.Factory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper) +305 Sitecore.Configuration.Factory.CreateObject(String configPath, String[] parameters, Boolean assert) +395 Sitecore.Search.SearchManager.get_SearchConfig() +71 Sitecore.Search.SearchManager.GetIndex(String id) +43 Sitecore.Shell.Applications.ShellForm.OnLoad(EventArgs e) +1331 [TargetInvocationException: Exception has been thrown by the target of an invocation.] System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) +0 System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) +1255 System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +38 Sitecore.Reflection.ReflectionUtil.InvokeMethod(MethodInfo method, Object[] parameters, Object obj) +91 Sitecore.Web.UI.Sheer.ClientPage.OnLoad(EventArgs e) +332 System.Web.UI.Control.LoadRecursive() +66 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2428 
+6
source share
2 answers

If you go to this page http: // [yourhostname] /sitecore/admin/showconfig.aspx

Finding any instances of the index element and checking the path <Root>path here</Root> node actually exists in your content tree

See the default index for an example.

 <index id="system" type="Sitecore.Search.Index, Sitecore.Kernel"> <param desc="name">$(id)</param> <param desc="folder">__system</param> <Analyzer ref="search/analyzer"/> <locations hint="list:AddCrawler"> <core type="Sitecore.Search.Crawlers.DatabaseCrawler,Sitecore.Kernel"> <Database>core</Database> <Root>/sitecore/content</Root> <include hint="list:IncludeTemplate"> <application>{EB06CEC0-5E2D-4DC4-875B-01ADCC577D13}</application> </include> <Tags>application</Tags> <Boost>2.0</Boost> </core> <core-controlpanel type="Sitecore.Search.Crawlers.DatabaseCrawler,Sitecore.Kernel"> <Database>core</Database> <Root>/sitecore/content/applications/control panel</Root> <include hint="list:IncludeTemplate"> <taskoption>{BDB6FA46-2F76-4BDE-8138-52B56C2FC47E}</taskoption> </include> <Tags>taskoption</Tags> <Boost>1.9</Boost> </core-controlpanel> <master type="Sitecore.Search.Crawlers.DatabaseCrawler,Sitecore.Kernel"> <Database>master</Database> <Tags>master content</Tags> </master> </locations> </index> 

After fixing any invalid root values, the site should work again.

+11
source

Problem Cause

This problem usually occurs when the lucene Sitecore index is declared. but <Root> it refers to not in the database .

Note. If the database is index oriented, this may be because you do not have published items.

Fix the problem

Since you cannot get to the Sitecore desktop, you will have to comment on the index causing the problem. If you do not know which one you need, you should use the normal trial version and error, because sitecore will not tell you.

To view all the indexes that you specified on your system, go to http://[yourhostname]/sitecore/admin/showconfig.aspx and search for <index . This is a combination of the entire configuration declared in App_Config.

The index will look like this:

 <index id="MyIndexId" type="Sitecore.Search.Index, Sitecore.Kernel"> 

Once you find that the culprit has commented on this, create or expand the missing root element in Sitecore. After that, add the index back.

+4
source

All Articles