Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Dynamics 365 - Server Side Synch Troubleshooting Tips Required

Posted on by 924

Our Dynamics CRM on-premise (v8.2.0.749) has been happily communicating with Exchange Server 2016. That was until last week when the Exchange Server was patched to CU12 and TLS1.2 became the only protocol available for communications.

It was at this point we noticed that the Server Side Synch for mailboxes started failing. We are not sure if TLS 1.2 is supported in CRM 365 on-premise (v8.2.0.749), looking at various blogs it appears it is supported, but only V9 makes it mandatory. Anyhow to avoid any issues with patches etc. I've updated our CRM to v8.2.4.0006 aka update 2.4), but this has had no affect on the mail features.

The following trace logs were captured when I switched on tracing and ran a connection test in the mail server profile:

[2019-05-01 14:51:53.634] Process:CrmAsyncService |Organization:1db0c0b6-ceee-418c-afc3-ebe6dc767040 |Thread: 18 |Category: ExchangeSync |User: 00000000-0000-0000-0000-000000000000 |Level: Error |ReqId: 00000000-0000-0000-0000-000000000000 |ActivityId: 2cc78fa0-56d2-4f0d-97fd-9a07f79ece35 | EmailConnectorTraceHandler.EmailConnectorTraceFormat ilOffset = 0x13E
>Exchange sync worker for the mailbox is failed/terminated : {0D380767-8C19-E411-80C0-0050569D09D9}. Exception details : Unhandled Exception: Microsoft.Exchange.WebServices.Data.ServiceRequestException: The request failed. The underlying connection was closed: An unexpected error occurred on a send.
> at Microsoft.Exchange.WebServices.Data.ServiceRequestBase.EndGetEwsHttpWebResponse(IEwsHttpWebRequest request, IAsyncResult asyncResult)
> at Microsoft.Exchange.WebServices.Data.SimpleServiceRequestBase.EndInternalExecute(IAsyncResult asyncResult)
> 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()
>Inner Exception: System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a send.
> at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
> at Microsoft.Exchange.WebServices.Data.EwsHttpWebRequest.Microsoft.Exchange.WebServices.Data.IEwsHttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
> at Microsoft.Exchange.WebServices.Data.ServiceRequestBase.EndGetEwsHttpWebResponse(IEwsHttpWebRequest request, IAsyncResult asyncResult)
>Inner Exception: System.IO.IOException: The handshake failed due to an unexpected packet format.
> at System.Net.TlsStream.EndWrite(IAsyncResult asyncResult)
> at System.Net.ConnectStream.WriteHeadersCallback(IAsyncResult ar)
>.
[2019-05-01 14:51:57.654] Process:CrmAsyncService |Organization:1db0c0b6-ceee-418c-afc3-ebe6dc767040 |Thread: 21 |Category: EmailConnector |User: 00000000-0000-0000-0000-000000000000 |Level: Error |ReqId: 00000000-0000-0000-0000-000000000000 |ActivityId: 9d47c0ba-750c-4d75-b265-ec8b0bd32331 | EmailConnectorTraceHandler.EmailConnectorTraceFormat ilOffset = 0x13E
>Mailbox : 0d380767-8c19-e411-80c0-0050569d09d9 is an inactive mailbox, we set the postpone time as DateTime Max. LastSyncErrorCode: 52.

This line looks significant:  "The handshake failed due to an unexpected packet format. at System.Net.TlsStream.EndWrite(IAsyncResult asyncResult)" 

Is this evidence that TLS 1.2 isn't supported, or is there likely to be something else wrong here and we are fixated on the wrong problem?
What's the best way to troubleshoot server-side synch errors between CRM and Exchange.

FYI. Both CRM and Exchange are on-premise and TLS1.2 has been enabled as the only protocol on the exchange server.

Many thanks

Steve

*This post is locked for comments

  • Steve Le Monnier Profile Picture
    Steve Le Monnier 924 on at
    RE: Dynamics 365 - Server Side Synch Troubleshooting Tips Required

    Ok, After several hours trying various actions I've found a way that works, although I don't fully understand why it works.
    To Recap; after the Exchange Server 2016 was hardened only allowing TLS1.2 protocols to connect, our CRM365 V8.2.0.749 On-Premise Server Side Synch stopped working.

    Things I've confirmed as making no difference to proceedings:

    1. Fiddle : Couldn't learn anything from this, because its not a webpage but a service talking to exchange, and I was never able to find which one, or see any traffic.
    2. Enabling TLS 1.2 and disabling TLS 1.0 and TLS 1.1 on the CRM Web Server played no part in getting the process working. This appears to me as a red-herring.
    3. Updating V8.2.0.749 to version V8.2.4.0006 does play a part in the solution, but not solely in our scenario as I will explain.

    Prior to update v8.2.4.6 nothing we tried got this working. Once v8.2.4.6 was installed, the only way I could get a successful mailbox test out of the Server Side Synchronisation was to completely ignore our mail profile settings for exchange, which contained the EWS\Exchange.asmx address and the relevant port numbers, and to setup a new exchange profile, but this time leaving all the settings on AUTO-DISCOVER (including where the exchange server was). By doing this I was able to successful test a mailbox and the test user did indeed receive an email from CRM advising their mailbox was now connected.

    If I put the user back onto the original (manually) configured profiles the tests failed once again.

    I'm happy I have a working approach, but I do not understand why the Auto-Discover implementation is working, but not when there is an actual address and port numbers. I know these addresses and port numbers are correct but not correct enough for CRM it seems.

    Does anybody have any theories as to why auto-discover works but the explicit addresses are not?

    Cheers
    Steve  

  • Suggested answer
    Syed Ibrahim Profile Picture
    Syed Ibrahim 6,257 on at
    RE: Dynamics 365 - Server Side Synch Troubleshooting Tips Required

    Yes you are right, but D365 on premise is released very later stage, by that time v9 preview were already on. So I guess it should also follow the same protocol. Just try and let me if this helps. Else let me do check at my server side.

    Hope this helps

  • Steve Le Monnier Profile Picture
    Steve Le Monnier 924 on at
    RE: Dynamics 365 - Server Side Synch Troubleshooting Tips Required

    Many thanks for this info... I'll grab a copy of fiddler tomorrow and take another look at this.

    One question I hope you can answer:

    Q. Forget V9, its very clear what you can and cannot do.... but does CRM 365 On-Premise support a TLS1.2 *only* environment?

    This is not clear, from what I can see thus far it seems to me that it should, but I cannot find anything that clearly states that TLS 1.2 only network will work with CRM365 on-prem, where as the V9 version is clear it will only work with TLS1.2

    Cheers

    Steve

  • Suggested answer
    Syed Ibrahim Profile Picture
    Syed Ibrahim 6,257 on at
    RE: Dynamics 365 - Server Side Synch Troubleshooting Tips Required

    Mostly the TLS1.2 or later applicable for V9, it's better remove the protocol. Hope it should work.

    For more information please have a look into my article posted last year for the same.

    mscrm365.blogspot.com/.../dynamics-crm-v9-connection-error-in.html

    Hope this helps.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans