We run a Dynamics CRM 2011 On Premise Server which also runs a SQL Server 2008 for the Dynamics database. It’s an All-in-One solution. One morning we had an obscure error message when trying to access our Dynamics CRM server. This kind of error message had previously raised when the Async Dynamics CRM Service was not running. But this was not the case then. Then checking the Event Log, I saw that there were messages about MSCrmKeyGenerator. The Error detail gave me some information about CrmWRPCTokenKey being expired. Taking a look into the Dynamics Crm Database, I saw in the table dbo.CrmKey that there was a record with CrmWRPCTokenKey. Searching in the table dbo.CrmKeyProperties with the Id of the CrmWRPCTokenKey from the previous table. I saw that the key had an expiration date, and this date was expired. I could have updated this record to set a date far in the future. But that would not have been a good way to actually solve the problem. In several Dynamics Forums I found that the answer was to restart Microsoft Dynamics Async Service. But as I tried before, this did not solve anything. On the Microsoft Dynamics forum I found another information saying to execute WRPCKeyRenewal.exe /R from a terminal on the server. This probably would have worked, but it would only have renewed the key once. This was not usable on a production environment. Checking again I saw that the Async (Maintenance) service was not started although its start type was Automatic. I changed the two Dynamics CRM services start type. I set it to automatic (Delayed). Restarting the server proved this simple fix solved the problem. I then Checked the Dynamics CRM Database to see if the expiration date have changed. In the dbo.CrmKey table, a new CrmWRPCTokenKey was created. And, in the dbo.CrmKeyProperties table, a new key was created with the Id of the previous table. And it had a valid ExpiresOn date. What can I learn from this error ? First : the CrmToken validity is managed by the Async (Maintenance) service Second : In a All-in-One Dynamics CRM Solution, the Sql Server may take more time to start than expected, and the Dynamics services may, in turn, start before the Sql Server is initialized. So the Token cannot be renewed.
Please leave a comment if you found this post useful. Thanks.