If you get an Unhandled Exception in your mailbox profile alerts, but no real information, where it comes from, then this post will help you.
I got the following alert in my mailbox:
1 2 3 4 5 6 7 8 9 10 |
<params> <param type="0" otc="9606" oid="48d028d3-8c53-e811-9103-005056a26140">Mittermair, Michael</param> <param type="0" otc="9605" oid="9dd1ce55-e851-e811-9102-005056a26140">MailProfile</param> </params> <details> <detail key="servererrorcode">Exchange.server returned ErrorInvalidSyncStateData error.</detail> <detail key="servererrorhelplink">Microsoft.Crm.Asynchronous.EmailConnector.ErrorSource.ExchangeError:ErrorInvalidSyncStateData</detail> </details> 1 NULL BACKEND ExchangeSyncUnknownACTIntegrationError 0 T:109 ActivityId: 8820ea97-0688-4cff-b9c7-b1fc8da070d6 |
I enabled the tracing on the backend server and also checked the log in the database and found the following:
1 2 3 4 5 6 7 8 |
>Exception : Unhandled Exception: Microsoft.Exchange.WebServices.Data.ServiceResponseException: Synchronization state data is corrupt or otherwise invalid. at Microsoft.Exchange.WebServices.Data.ServiceResponse.InternalThrowIfNecessary() at Microsoft.Exchange.WebServices.Data.MultiResponseServiceRequest`1.EndExecute(IAsyncResult asyncResult) at Microsoft.Exchange.WebServices.Data.ExchangeService.EndSyncFolderHierarchy(IAsyncResult asyncResult) at Microsoft.Crm.Asynchronous.EmailConnector.MonitoredExchangeService.EndSyncFolderHierarchy(IAsyncResult asyncResult) at Microsoft.Crm.Asynchronous.EmailConnector.ExchangeSyncSteps.ExchangeSyncAsyncRemoteStep`2.AfterCall() at Microsoft.Crm.Asynchronous.EmailConnector.ExchangeSyncSteps.ExchangeSyncAsyncRemoteStep`2.Execute() at Microsoft.Crm.Asynchronous.EmailConnector.ExchangeSyncWorker.SynchronizeACTs() |
Based on the first error message, I could elicit, that it is connected to an activity. And that it’s connected to the ACT-Settings in my Sync-Profile. Therefore I checked the settings which looked like the following:
- A specific user for synchronization. This user has impersonation-rights on the mailboxes of the crm users.
Based on the Microsoft documentation https://docs.microsoft.com/en-us/dynamics365/customer-engagement/admin/best-practices-server-side-synchronization there is a hint, that ACT is not supported with Mailbox Impersonation.
Therefore I changed my profile to enter my own credentials for the mailbox and the error disappeared and the sync worked again for ACT.