"Save operation for definition could not be completed within specified timeframe" message when trying to create email campaign


Description

The problem occurs because of the high load or\and network connectivity problem. The following error can appear in log files:

ERROR One or more exceptions occurred while processing the subscribers to the 'item:saved' event.
Exception[1]: System.TimeoutException 
Message[1]: Save operation for definition id:[{4DD03672-8944-44C9-9F26-900C421F49B4}] could not be completed within specified timeframe. It will be re-run in the background. 
Source[1]: Sitecore.Analytics 
   at Sitecore.Analytics.Reporting.DefinitionData.Marketing.Deployment.Processors.Deploy.DeployItem[TDefinition](Item item, Template itemTemplate, ID expectedTemplateId)
   at Sitecore.Analytics.Reporting.DefinitionData.Marketing.Deployment.Processors.Deploy.Process(DeployDefinitionArgs args)
   at (Object , Object[] )
   at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args)
   at Sitecore.Analytics.Pipelines.DeployDefinition.DeployDefinitionPipeline.<>c__DisplayClass1.<Run>b__0()
   at Sitecore.Marketing.Core.IgnoreRecursiveCalls.Run(ID id, Action action)
   at Sitecore.Analytics.Pipelines.DeployDefinition.DeployDefinitionPipeline.Run(Item item)
   at Sitecore.Analytics.Data.Items.ItemEventHandler.OnItemSaved(Object sender, EventArgs args)
   at Sitecore.Events.Event.EventSubscribers.RaiseEvent(String eventName, Object[] parameters, EventResult result)

It is generated when deploying of a marketing definition takes more than 30 seconds. So, the issue appears when it takes longer time in the solution at the mentioned circumstances.

Solution

For Sitecore XP versions prior to 9.1 Initial Release, download and install the patch compatible with the affected product version found on the following page: https://github.com/SitecoreSupport/Sitecore.Support.116539.

Starting from Sitecore XP version 9.1 Initial Release, the time for deploying marketing definitions can be changed in the following way:

    1. Set DeployItemTimeout for the Sitecore.Marketing.xMgmt.Pipelines.DeployDefinition.Deploy processor.
    2. Add the setting to the \App_Config\Sitecore\Marketing.Operations.xMgmt\Sitecore.Marketing.config file as follows:
<deployDefinition>
<processor type="Sitecore.Marketing.xMgmt.Pipelines.DeployDefinition.Deploy, Sitecore.Marketing.xMgmt" resolve="true">
<DeployItemTimeout>00:01:30</DeployItemTimeout>
</processor>
</deployDefinition>