Import solution. Message: Cannot insert duplicate key. RRS feed

  • Question

  • We get this following error when trying to import a solution to CRM 2016 SP1. 

    Someone know whats wrong? 

    We have a ongoing Microsoft support incident on this case but they dont seem to be able to solve the problem. 

    11:19:45.803          Import message:
    Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: Cannot insert duplicate key.Detail: 
    <OrganizationServiceFault xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/xrm/2011/Contracts">
      <ErrorDetails xmlns:d2p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
      <Message>Cannot insert duplicate key.</Message>
        <ErrorDetails xmlns:d3p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
        <Message>Cannot insert duplicate key.</Message>
        <InnerFault i:nil="true" />
        <TraceText i:nil="true" />
      <TraceText i:nil="true" />
       at Microsoft.Crm.Extensibility.OrganizationSdkServiceInternal.Execute(OrganizationRequest request, CorrelationToken correlationToken, CallerOriginToken callerOriginToken, WebServiceType serviceType, Boolean checkAdminMode, ExecutionContext executionContext)
       at Microsoft.Crm.Extensibility.InprocessServiceProxy.ExecuteCore(OrganizationRequest request)
       at Microsoft.Crm.Asynchronous.ExecuteSdkMessageOperation.InternalExecute(AsyncEvent asyncEvent)

    11:19:45.803          Message: Cannot insert duplicate key.
    11:19:45.806          See log file for technical details.
    11:19:45.810        END DoImportSolutionAsync

    Monday, January 30, 2017 10:42 AM

All replies

  • Hi,

    I suspect you are possibly trying to update/create an entity that has a optionset value that already exists on your target system.

    Your installation log should should show you where it stops (but often doesn't say very much). However it should indicate the field you are trying to update/insert.

    If this is the issue, give me a shout I have a few (maybe 2 ) work arounds for the issue.



    Tuesday, January 31, 2017 3:23 AM
  • Thanks, that was also what I thougt, but the log refers to a cutom entity that does not have any optionesets.  :/ 
    Tuesday, January 31, 2017 8:44 AM