INTRODUCTION
A CRM 2013 application has been running for more than a year and out of nowhere user can’t get into CRM from the browser.
Then upon checking the Event Viewer, they’re getting the following every 1-5 minutes:
==
The current active key (KeyType : CrmWRPCTokenKey) is expired. This may indicate that a key is not being regenerated correctly. Current Active Key : CrmKey(Id:c9643987-c39a-e411-80d6-005056ba6cbc, ScaleGroupId:00000000-0000-0000-0000-000000000000, KeyType:CrmWRPCTokenKey, Expired:True, ValidOn:01/13/2015 01:28:52, ExpiresOn:02/15/2015 01:28:52, CreatedOn:01/13/2015 01:28:52, CreatedBy:DOMAIN\PRODASYNC. Key Setting : CrmKeySetting(Id:a25534e8-f95d-4885-9b90-91894176bba3, KeyType:CrmWRPCTokenKey, KeyLength:128, KeyGenerationInterval:720, KeyTimeToLive:792, CryptoTimeToLive:72, Algorithm:HMACSHA256, ArchiveLength:1, Enabled:True, ActiveKeys:[ScaleGroupId=00000000-0000-0000-0000-000000000000,ActiveKeyId=c9743987-c39a-e411-80d6-005056ba6cbc])
==
Monitoring runtime failed: Machine: CRM2013VM: Exception: The type initializer for ‘Microsoft.Crm.Monitoring.Engine.MonitoringRuntime’ threw an exception.
at Microsoft.Crm.Monitoring.Engine.MonitoringRuntime.RetrieveServerRolesForMachine(String machineName)
at Microsoft.Crm.Monitoring.Engine.MonitoringRuntime..ctor(TestFrequency testFrequency)
InnerException Type:System.TypeInitializationException
The type initializer for ‘Microsoft.Crm.Monitoring.MonitoringSettings’ threw an exception.
at Microsoft.Crm.Monitoring.MonitoringSettings.get_MaxExecuteTestAttempts()
at Microsoft.Crm.Monitoring.ResultTracker..ctor()
at Microsoft.Crm.Monitoring.Engine.MonitoringRuntime..cctor()
InnerException Type:System.TypeInitializationException
Login failed for user ‘DOMAIN\ProdMonitoring’.
at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection)
at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection)
at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)
at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
at System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1 retry)
at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)
at System.Data.SqlClient.SqlConnection.Open()
at Microsoft.Crm.CrmDbConnection.GetCreateAndOpenConnection()
at Microsoft.Crm.CrmDbConnection.Open()
at Microsoft.Crm.SharedDatabase.DatabaseMetadata.LoadMetadataXmlFromDatabase(CrmDBConnectionType connectionType, String connectionString, Int32& maxBlobSize)
at Microsoft.Crm.ConfigurationDatabase.ConfigurationMetadata.get_Cache()
at Microsoft.Crm.SharedDatabase.DatabaseService.Initialize(String tableName)
at Microsoft.Crm.SharedDatabase.DatabaseService.RetrieveInternal(String tableName, String[] columns, PropertyBag[] conditions, Nullable`1 top, IList`1 orderBy, IDictionary collectionToFill)
at Microsoft.Crm.SharedDatabase.DatabaseService.Retrieve(String tableName, String[] columns, PropertyBag[] conditions)
at Microsoft.Crm.ServerLocatorService.Retrieve(String tableName, String[] columns, PropertyBag[] conditions)
at Microsoft.Crm.Monitoring.MonitoringSettings..cctor()
InnerException Type:System.Data.SqlClient.SqlException
.
==
RESOLUTION
I checked with the ICT Team to ensure that passwords for service accounts didn’t change nor they expire nor locked. Everything looked green from their side.
So what I did to resolve the issue was the following:
– Restart Microsoft Dynamics CRM Asynchronous Processing Service
– Restart Microsoft Dynamics CRM Asynchronous Processing Service (maintenance)
– Open command prompt and run the following:
C:\Program Files\Microsoft Dynamics CRM\tools\Microsoft.Crm.Tools.WRPCKeyRenewal.exe /R
– Restart Microsoft Dynamics CRM Monitoring Service
– IISRESET
And done. I no longer get any errors in Event Viewer and users can now access CRM again.
Hope this helps,
Tommy