ob1dev / Sitecore-Azure-Setup

WebRole Entry Point that provides methods to run Sitecore code when a role instance is initialized.
https://www.nuget.org/packages/Sitecore.Azure.Setup/
MIT License
0 stars 1 forks source link

Rebuild fails on Sitecore 7.2.0 with strange message #2

Open akuryan opened 8 years ago

akuryan commented 8 years ago

12876 08:59:22 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)

12876 08:59:22 ERROR First 200 characters: extranet\Anonymous 12876 08:59:22 ERROR Call stack: at Sitecore.MainUtil.GetCallStack() at Sitecore.Xml.XmlUtil.LoadXml(String xml) at Sitecore.Data.Locking.ItemLocking.GetLockField() at Sitecore.Data.Locking.ItemLocking.HasLock() at Sitecore.Search.Crawlers.DatabaseCrawler.AddSpecialFields(Document document, Item item) at Sitecore.Search.Crawlers.DatabaseCrawler.IndexVersion(Item item, Item latestVersion, IndexUpdateContext context) at Sitecore.Search.Crawlers.DatabaseCrawler.AddItem(Item item, IndexUpdateContext context) at Sitecore.Search.Crawlers.DatabaseCrawler.AddTree(Item root, IndexUpdateContext context) at Sitecore.Search.Crawlers.DatabaseCrawler.AddTree(Item root, IndexUpdateContext context) at Sitecore.Search.Crawlers.DatabaseCrawler.AddTree(Item root, IndexUpdateContext context) at Sitecore.Search.Crawlers.DatabaseCrawler.AddTree(Item root, IndexUpdateContext context) at Sitecore.Search.Crawlers.DatabaseCrawler.AddTree(Item root, IndexUpdateContext context) at Sitecore.Search.Crawlers.DatabaseCrawler.AddTree(Item root, IndexUpdateContext context) at Sitecore.Search.Crawlers.DatabaseCrawler.AddTree(Item root, IndexUpdateContext context) at Sitecore.Search.Crawlers.DatabaseCrawler.AddTree(Item root, IndexUpdateContext context) at Sitecore.Search.Index.Rebuild() at Sitecore.Azure.Startup.SearchIndexRebuilder.<>cDisplayClass5.b4() at System.Threading.Tasks.Task.Execute() 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.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot) at System.Threading.Tasks.Task.ExecuteEntry(Boolean bPreventDoubleExecution) at System.Threading.ThreadPoolWorkQueue.Dispatch()

ob1dev commented 8 years ago

The reason of the error is because the index-rebuilding operation has been run under the extranet\Anonymous user, which does not have access right to read the Lock field value.

The interesting part that it happened for Sitecore legacy search indexes based on the Sitecore.Search API. Most likely you are using the new Sitecore.ContentSearch API. If yes, it makes sense to rebuild only new indexes and completely disable the legacy one, which is going to be removed in Sitecore 8.X.

If you confirm you are not using the legacy indexes, I will disable the code which rebuilds them and release an update for the NuGet package.

akuryan commented 8 years ago

I supposed previously that in Sitecore 7.2 legacy indexes is already disabled by default. And, as far as I see - we do not use legacy indexes

ob1dev commented 8 years ago

Unfortunately, the legacy indexes are on and running even in Sitecore XP 8.1.

Let me disable rebuilding of the legacy index and release a new package. For the meantime, you can perform the following steps to disable them in your Sitecore solution. I presume it should fix the above error.

  1. In the Web.config file, set the Indexing.UpdateInterval setting to the 00:00:00 value.
  2. In the Web.config file, remove the system index definition with entire <indexes> section under the \configuration\sitecore\search\configuration element:

    <search>
    ...
     <configuration type="Sitecore.Search.SearchConfiguration, Sitecore.Kernel" singleInstance="true">
       <indexes hint="list:AddIndex">
         <index id="system" type="Sitecore.Search.Index, Sitecore.Kernel">
          ...
         </index>
       </indexes>
     </configuration>
    </search>
  3. In the file system, removed the \Data\Indexing\__system directory that belongs to legacy Sitecore Search API.