Monday, 23 February 2015

CRM Outlook client error

Recently we tried to install Dynamics CRM outlook client for CRM 2013 on a specific organisation and it failed with following error:

Microsoft.Crm.Application.Outlook.Config.OutlookConfigurator.InitializeMapiStoreForFirstTime
10:17:28| Error| Exception : |NativeError:61b8 HResult 80040e2f Message: A duplicate value cannot be inserted into a unique index. [ Table name = MetadataSchema.EntityClientStatistics,Constraint name = PK__MetadataSchema.EntityClientStatistics__0000000000000780 ]| at Microsoft.Crm.Application.SMWrappers.CrmSqlCeCommand.ExecuteCommandWithRetry[TResult](Func`1 body, Int32 retryCount)
at Microsoft.Crm.Application.Outlook.ClientMetadataCache.SqlCeManager.ExecuteStepsInTransaction(SqlCeTransaction tx, String[] commands)
at Microsoft.Crm.Application.Outlook.ClientMetadataCache.SqlCeManager.<>c__DisplayClassd.<CommitChanges>b__c(CrmSqlCeConnection conn)
at Microsoft.Crm.Application.SMWrappers.CrmSqlCeConnection.<>c__DisplayClass8.<ExecuteInNewConnection>b__7(CrmSqlCeConnection connection)
at Microsoft.Crm.Application.SMWrappers.CrmSqlCeConnection.ExecuteInNewConnection[TReturn](String connectionString, Func`2 actions, Func`2 exceptionHandler)
at Microsoft.Crm.Application.Outlook.ClientMetadataCache.MetadataCacheManager.IncrementVersion(Object infoObj)
at Microsoft.Crm.Application.Outlook.ClientMetadataCache.MetadataCacheManager.SyncComplete(Guid orgId, ISync sync, Boolean forceSyncIncrement)
at Microsoft.Crm.Application.Outlook.ClientMetadataCache.ClientDynamicMetadataCache.<>c__DisplayClass23.<DoSyncInternal>b__22()
at Microsoft.Crm.Application.Outlook.ClientMetadataCache.DeferredDynamicMetadataCache.ExecuteWhenReady(Action action)
at Microsoft.Crm.Application.Outlook.ClientMetadataCache.ClientDynamicMetadataCache.DoSyncInternal(IOrganizationContext context)
at Microsoft.Crm.Application.Outlook.ClientMetadataCache.ClientDynamicMetadataCache.<>c__DisplayClass1b.<.ctor>b__18()
at Microsoft.Crm.Application.Outlook.ClientMetadataCache.ClientDynamicMetadataCache..ctor(IOrganizationContext context, Boolean reloadAsynchronously)
at Microsoft.Crm.Application.Outlook.ClientMetadataCache.ClientDynamicMetadataCache.LoadCache(IOrganizationContext context, Boolean unusedHere)
at Microsoft.Crm.Metadata.MetadataCache.GetInstance(IOrganizationContext context)
at Microsoft.Crm.Application.Outlook.Config.OutlookConfigurator.InitializeMapiStoreForFirstTime()
at Microsoft.Crm.Application.Outlook.Config.OutlookConfigurator.Configure(IProgressEventHandler progressEventHandler)
at Microsoft.Crm.Application.Outlook.Config.ConfigEngine.Configure(Object stateInfo)
10:17:28| Error| Exception : A duplicate value cannot be inserted into a unique index. [ Table name = MetadataSchema.EntityClientStatistics,Constraint name = PK__MetadataSchema.EntityClientStatistics__0000000000000780 ] at System.Data.SqlServerCe.SqlCeCommand.ProcessResults(Int32 hr)
at System.Data.SqlServerCe.SqlCeCommand.ExecuteCommandText(IntPtr& pCursor, Boolean& isBaseTableCursor)
at System.Data.SqlServerCe.SqlCeCommand.ExecuteCommand(CommandBehavior behavior, String method, ResultSetOptions options)
at System.Data.SqlServerCe.SqlCeCommand.ExecuteNonQuery()
at Microsoft.Crm.Application.SMWrappers.CrmSqlCeCommand.<ExecuteNonQuery>b__0()
at Microsoft.Crm.Application.SMWrappers.CrmSqlCeCommand.ExecuteCommandWithRetry[TResult](Func`1 body, Int32 retryCount)

Thanks to my friend and colleague Rafael Urbano to finding a solution to this issue. Found few articles for this issue which suggested we log a support call for this but we found the solution.

Connect to Plug-in registration tool and check if Plug-in Profiler is enabled. If this is enabled, the error could be due to that. This was an issue for us. When we disabled the plug-in profiler, the issue was resolved for us.

Hope this helps.

1 comment:

  1. Having read this I thought it was really enlightening.
    I appreciate you finding the time and energy to put this article together.
    I once again find myself personally spending a significant 
    amount of time both reading and commenting. But so what, it was still worth it!

    ReplyDelete