0

I'm running a publish on the content tree of my sitecore instance and at some point the publish crashes.

Is there an easy way of knowing which item is causing the problem? I don't see on the logs the item ID at any point... here is the exception I get:

10336 17:56:05 ERROR An error during Publish Pipeline Process Queue execution.
Exception: System.AggregateException
Message: One or more exceptions occurred while processing the subscribers to the 'item:deleted' event.
Source: Sitecore.Kernel
at Sitecore.Events.Event.EventSubscribers.RaiseEvent(String eventName, Object[] parameters, EventResult result)
at Sitecore.Events.Event.RaiseEvent(String eventName, Object[] parameters)
at System.EventHandler`1.Invoke(Object sender, TEventArgs e)
at Sitecore.Data.Engines.EngineCommand`2.RaiseEvent[TArgs](EventHandler`1 handlers, Func`2 argsCreator)
at Sitecore.Data.Engines.EngineCommand`2.Execute()
at Sitecore.Data.Engines.DataEngine.DeleteItem(Item item)
at Sitecore.Data.Managers.PipelineBasedItemProvider.ExecuteAndReturnResult[TArgs,TResult](String pipelineName, String pipelineDomain, Func`1 pipelineArgsCreator, Func`1 fallbackResult)
at Sitecore.Data.Managers.PipelineBasedItemProvider.DeleteItem(Item item, SecurityCheck securityCheck)
at Sitecore.Nexus.Data.DataCommands.DeleteItemCommand.(Item )
at Sitecore.Nexus.Data.DataCommands.DeleteItemCommand.DeleteItem(Item , Boolean )
at Sitecore.Nexus.Data.DataCommands.DeleteItemCommand.Execute(Item , ID )
at Sitecore.Data.Engines.DataCommands.DeleteItemCommand.DoExecute()
at Sitecore.Data.Engines.EngineCommand`2.Execute()
at Sitecore.Data.Engines.DataEngine.DeleteItem(Item item)
at Sitecore.Data.Managers.PipelineBasedItemProvider.ExecuteAndReturnResult[TArgs,TResult](String pipelineName, String pipelineDomain, Func`1 pipelineArgsCreator, Func`1 fallbackResult)
at Sitecore.Data.Managers.PipelineBasedItemProvider.DeleteItem(Item item, SecurityCheck securityCheck)
at Sitecore.Nexus.Data.DataCommands.DeleteItemCommand.(Item )
at Sitecore.Nexus.Data.DataCommands.DeleteItemCommand.DeleteItem(Item , Boolean )
at Sitecore.Nexus.Data.DataCommands.DeleteItemCommand.Execute(Item , ID )
at Sitecore.Data.Engines.DataCommands.DeleteItemCommand.DoExecute()
at Sitecore.Data.Engines.EngineCommand`2.Execute()
at Sitecore.Data.Engines.DataEngine.DeleteItem(Item item)
at Sitecore.Data.Managers.PipelineBasedItemProvider.ExecuteAndReturnResult[TArgs,TResult](String pipelineName, String pipelineDomain, Func`1 pipelineArgsCreator, Func`1 fallbackResult)
at Sitecore.Data.Managers.PipelineBasedItemProvider.DeleteItem(Item item, SecurityCheck securityCheck)
at Sitecore.Nexus.Data.DataCommands.DeleteItemCommand.(Item )
at Sitecore.Nexus.Data.DataCommands.DeleteItemCommand.DeleteItem(Item , Boolean )
at Sitecore.Nexus.Data.DataCommands.DeleteItemCommand.Execute(Item , ID )
at Sitecore.Data.Engines.DataCommands.DeleteItemCommand.DoExecute()
at Sitecore.Data.Engines.EngineCommand`2.Execute()
at Sitecore.Data.Engines.DataEngine.DeleteItem(Item item)
at Sitecore.Data.Managers.PipelineBasedItemProvider.ExecuteAndReturnResult[TArgs,TResult](String pipelineName, String pipelineDomain, Func`1 pipelineArgsCreator, Func`1 fallbackResult)
at Sitecore.Data.Managers.PipelineBasedItemProvider.DeleteItem(Item item, SecurityCheck securityCheck)
at Sitecore.Publishing.PublishHelper.DeleteTargetItem(ID itemId)
at Sitecore.Publishing.Pipelines.PublishItem.PerformAction.ExecuteAction(PublishItemContext context)
at Sitecore.Publishing.Pipelines.PublishItem.PerformAction.Process(PublishItemContext context)
at (Object , Object[] )
at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args)
at Sitecore.Publishing.Pipelines.PublishItem.PublishItemPipeline.Run(PublishItemContext context)
at Sitecore.Publishing.Pipelines.Publish.ProcessQueue.ProcessPublishingCandidate(PublishingCandidate entry, PublishContext context, List`1& referrers, List`1& children)
at Sitecore.Publishing.Pipelines.Publish.ProcessQueue.ProcessPublishingCandidate(PublishingCandidate entry, PublishContext context)
at Sitecore.Publishing.Pipelines.Publish.ProcessQueue.ProcessEntries(IEnumerable`1 entries, PublishContext context)
at Sitecore.Publishing.Pipelines.Publish.ProcessQueue.Process(PublishContext context)
  • Can you change your publishing logging to DEBUG. That should show us the ID. In your sitecore.config. Change INFO to DEBUG. <logger name="Sitecore.Diagnostics.Publishing" additivity="false"> <level value="INFO" /> <appender-ref ref="PublishingLogFileAppender" /> </logger> – Chris Auer Nov 10 '16 at 14:42
3

In order to know which item is causing this issue, you will need to hook into the event publish:itemProcessing. I have a blog that I have written to know what items have already been published. The link is here

Below is a code snippet that allows you to know how to retrieve the item

public void OnItemProcessed(object sender, EventArgs args)
{
    var itemArgs = args as ItemProcessedEventArgs;

    if (itemArgs != null)
    {
        var publishContext = itemArgs.Context.PublishContext;

        if (itemArgs.Context.PublishOptions.Mode == PublishMode.Incremental)
        {
            var processedItems = publishContext.ProcessedItems;

            var itemsToProcess = PublishQueue.GetPublishQueue(itemArgs.Context.PublishOptions).Count();

            var totalItems = Math.Pow(itemArgs.Context.PublishContext.Languages.Count(), 2) +
                         (itemArgs.Context.PublishContext.Languages.Count() * itemsToProcess);

            foreach (var processedItem in processedItems)
            {
                var item = Factory.GetDatabase("master").Items.GetItem(new ID(processedItem));

                if (item != null)
                {
                    var publishedItems = new PublishedItemEntity
                    {
                        ItemId = item.ID,
                        ItemName = item.DisplayName,
                        ItemPath = item.Paths.ContentPath
                    };
                }                
            }
        }
    }
}

Since I have updated the tool on Sitecore Marketplace which is still in review phase, please check my GitHub Repository for the code and there is a Sitecore Package of the tool.

1

Its very generic message and very difficult to point out the exact item.

However you can use below tricks to identify it

  1. You can write your own event and override pipeline for publishing. Now publish each item programatically within TRY block. Within catch block you should log the item detail.

  2. You can check [PublishQueue] table in SQL server

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.