Gravatar for wrolloff@gmail.com

Question by Will Rolloff, Nov 25, 2015 4:55 PM

Index error when deleting a Sitecore item

When we delete a Sitecore item it is properly removed from the acproductsmaster index, but not the target site indexes (acproductswebindex and acproductspubindex). In the log file, we see the following error. Any idea what might cause this issue?

ManagedPoolThread #17 16:54:04 INFO  Job started: Index_Update_IndexName=ac_products_pub_index
ManagedPoolThread #17 16:54:04 ERROR Exception
Exception: System.Reflection.TargetInvocationException
Message: Exception has been thrown by the target of an invocation.
Source: mscorlib
   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 System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
   at Sitecore.Jobs.JobRunner.RunMethod(JobArgs args)
   at (Object , Object[] )
   at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args)
   at Sitecore.Jobs.Job.ThreadEntry(Object state)

Nested Exception

Exception: System.NullReferenceException
Message: Object reference not set to an instance of an object.
Source: Coveo.SearchProviderBase
   at Coveo.SearchProvider.ProviderIndexBase.Initialize(IIndexDocumentPropertyMapper`1 p_DocumentTypeMapper)
   at Coveo.SearchProvider.ProviderIndex.Initialize()
   at Coveo.SearchProvider.ProviderIndex.CreateUpdateContext()
   at Sitecore.ContentSearch.AbstractSearchIndex.PerformUpdate(IEnumerable`1 indexableInfo, IndexingOptions indexingOptions)
1 Reply
Gravatar for jflheureux@coveo.com

Answer by Jean-François L'Heureux, Nov 25, 2015 5:32 PM

Hi,

Normally, deleting an item in a Sitecore database only triggers the removal of its associated indexed documents in the Sitecore indexes that crawl this database. So deleting your item in the master database should only remove it from your acproductsmaster index.

Normally, the indexed documents are removed from the other Sitecore indexes (web, pub…) only when the site (or deleted item parent sub-tree) is published in those databases.

Maybe the error you see in the logs is not related to the delete operation. Maybe it's a false positive error (see Coveo with Sitecore not indexing web database).

Gravatar for vlambert@coveo.com

Comment by vince, Nov 26, 2015 8:43 AM

The stack trace has been confirmed to be an issue in Coveo for Sitecore, and will be solved with the upcoming December 2015 release. It is rather benign, and not related to the experienced behavior.

Jean-François is right, the web and pub indexes are only updated during a publish, a rebuild or a re-index operation.

Gravatar for wrolloff@gmail.com

Comment by Will Rolloff, Nov 26, 2015 11:08 AM

After deleting the item I published the parent item (Smart Publish, All subitems, Related items, both targets). The item itself is removed from all databases, but not the indexes. This causes an error on the website as the item returns from a product category search, but does not exist. I have also confirmed the items remain in the web and pub indexes through the Coveo index browser. The diagnostic pages are all green. If I rebuild the indexes it returns to normal.

Gravatar for jflheureux@coveo.com

Comment by Jean-François L'Heureux, Nov 26, 2015 11:15 AM

Do you see errors in the logs at the time of the smart publish and right after? The items are indexed just after a publish normally. They are indexed when the target index strategy is OnPublishEndAsynchronousStrategy.

Can you give me:

  • Your Sitecore version (Major, minor, revision)
  • Your Coveo for Sitecore version (Major, minor, build)
  • Your web and pub indexes strategy types.
  • Errors with stacktrace that happens while publishing or just after.

Thanks

Gravatar for wrolloff@gmail.com

Comment by Will Rolloff, Nov 26, 2015 1:34 PM

Yes, those errors happen after the smart publish.

Sitecore 7.5 (rev. 150212)

Coveo for Sitecore 3.0.1000

The strategies tied to the pub index are:

<strategies>
    <strategy type="Sitecore.ContentSearch.Maintenance.Strategies.OnPublishEndAsynchronousStrategy, Sitecore.ContentSearch">
        <param desc="database">pub</param>
        <CheckForThreshold>true</CheckForThreshold>
    </strategy>
    <prodCatOnPublishEndAsync type="ActiveCommerce.ContentSearch.Maintenance.Strategies.ProductCategoryOnPublishEndStrategy, ActiveCommerce.ContentSearch">
        <param desc="database">pub</param>
    </prodCatOnPublishEndAsync>
    <variableProdOnPublishEndAsync type="ActiveCommerce.ContentSearch.Maintenance.Strategies.VariableProductOnPublishEndStrategy, ActiveCommerce.ContentSearch">
        <param desc="database">pub</param>
    </variableProdOnPublishEndAsync>
</strategies>

When I delete the item, I see this error:

ManagedPoolThread #7 16:51:01 ERROR Exception
Exception: System.Reflection.TargetInvocationException
Message: Exception has been thrown by the target of an invocation.
Source: mscorlib
   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 System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
   at Sitecore.Jobs.JobRunner.RunMethod(JobArgs args)
   at (Object , Object[] )
   at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args)
   at Sitecore.Jobs.Job.ThreadEntry(Object state)

Nested Exception

Exception: System.NullReferenceException
Message: Object reference not set to an instance of an object.
Source: Coveo.SearchProviderBase
   at Coveo.SearchProvider.ProviderIndexBase.Initialize(IIndexDocumentPropertyMapper`1 p_DocumentTypeMapper)
   at Coveo.SearchProvider.ProviderIndex.Initialize()
   at Coveo.SearchProvider.ProviderIndex.CreateUpdateContext()
   at Coveo.SearchProvider.ProviderIndex.<>c__DisplayClass57.<Update>b__56()
   at Coveo.SearchProvider.ProviderIndex.Update(IEnumerable`1 p_IndexableUniqueIds)

When I publish, I see the error above as well as a few of these errors:

ManagedPoolThread #13 16:53:30 ERROR Exception
Exception: System.Reflection.TargetInvocationException
Message: Exception has been thrown by the target of an invocation.
Source: mscorlib
   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 System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
   at Sitecore.Jobs.JobRunner.RunMethod(JobArgs args)
   at (Object , Object[] )
   at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args)
   at Sitecore.Jobs.Job.ThreadEntry(Object state)

Nested Exception

Exception: System.NullReferenceException
Message: Object reference not set to an instance of an object.
Source: Coveo.SearchProviderBase
   at Coveo.SearchProvider.ProviderIndexBase.Initialize(IIndexDocumentPropertyMapper`1 p_DocumentTypeMapper)
   at Coveo.SearchProvider.ProviderIndex.Initialize()
   at Coveo.SearchProvider.ProviderIndex.CreateUpdateContext()
   at Sitecore.ContentSearch.AbstractSearchIndex.PerformUpdate(IEnumerable`1 indexableInfo, IndexingOptions indexingOptions)
Gravatar for jflheureux@coveo.com

Comment by Jean-François L'Heureux, Nov 26, 2015 2:00 PM

This problem begins to be too complicated to troubleshoot on this Q&A website. Can you open a support ticket with that information please?

  • A link to this discussion
  • Your log files containing the errors
  • Your Active Commerce and Coveo configuration files
  • A saved result of the ShowConfig.aspx page on your instance

Thanks,

Jeff

Ask a question