Search code examples
sql-servertimeoutdynamics-crmemail-router

Email Router - when updating Mailbox's email address returns SQL timeout error


I have an on-premise CRM 2016 instance and I can't receive any incoming emails inside of it even though when I run the test access says everything is good.

First, I'm unable to change a queue record email address, because I keep getting a SQL timeout error (doesn't matter how much time you increase the timeout it will never change) but if I try to change any other field it works and saves (but not the email field of course).

The same with the Mailbox's records, when I try to change the email it returns a SQL timeout error.

So what I did was change these emails by SQL queries, but after that the emails still won't create inside CRM.

It shows the next warning log in the event viewer:

35241 - The recipients for the email message with subject "[x]" in mailbox [email address] did not match any known records.

I'm running out of choices here, when I run the diagnosis tool on my organization it's performance is good but there must be something obstructing the communication with the SQL? Any clues?

SQL timeout error:

Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: SQL timeout expired.Detail: -2147204783 SQL timeout expired. 2018-10-10T14:14:15.5749939Z


Solution

  • I got the answer from Microsoft Community Forumns, thanks to Radu Chiribelea:

    It's not enough to change the email address in SQL in it's base table for a record, so that this can be used for email tracking. There are other references as well - for example the EmailSearchBase. This is why you need to let the platform handle your changes.

    You biggest issue here is the SQL Timeout and that is what you need to address. Since this occurs at a Create / Update I suspect there might be a deadlock somewhere. Do you have any plug-ins or workflows triggered at the time you create / update? If you disable those, do you still see the issue?

    Can you enable a CRM Platform trace at a Verbose Level while reproducing the issue? This would give you a better overview of the actual timeout and you can then start from there to tackle it.