Bounce handling fails with EXM Delivery Cloud


Description

Bounces statistic might not be collected when using EXM Delivery Cloud. The issue occurs because the EXM Delivery Cloud reads an incorrect property from a bounce message and thus fails to parse the contact. This results in 0% for bounce value in reports and the following errors in the logs:

23408 16:13:09 ERROR Bounce processing failed
Exception: System.AggregateException
Message: One or more errors occurred.
Source: mscorlib
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at Sitecore.EDS.Providers.SparkPost.Tasks.BouncesTaskProcessor.HandleMessageEvents(CancellationToken cancellationToken, List`1 messageEventResponses)
   at Sitecore.EDS.Providers.SparkPost.Tasks.BaseTaskProcessor.OnProcess(ShortRunningTask task, CancellationToken cancellationToken)

Nested Exception
Exception: System.ArgumentNullException
Message: value should not be null.
Parameter name: value
Source: Sitecore.Framework.Conditions
   at Sitecore.Framework.Conditions.RequiresValidator`1.ThrowExceptionCore(String condition, String additionalMessage, ConstraintViolationType type)
   at Sitecore.Framework.Conditions.Throw.ValueShouldNotBeNull[T](ConditionValidator`1 validator, String conditionDescription)
   at Sitecore.Framework.Conditions.ValidatorExtensions.IsNotNull[T](ConditionValidator`1 validator)
   at Sitecore.Modules.EmailCampaign.Core.Contacts.ContactIdentifierExtensions.ToContactIdentifier(String value)
   at Sitecore.EmailCampaign.Cm.Handlers.BouncedMessageHandler.HandleReportedMessages(ICollection`1 bouncedMessages)
   at Sitecore.EDS.Core.Reporting.DeliveryReportProvider`1.<HandleMessages>d__8.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Sitecore.EDS.Core.Reporting.DeliveryReportProvider`1.<HandleReportedMessages>d__7.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Sitecore.EDS.Core.Reporting.BounceManager.<HandleBouncedMessages>d__6.MoveNext()

Solution

To resolve the issue, consider one of the following options: