Search code examples
deploymentdynamics-crm-2015

Dynamics CRM deployment issue


We are trying to deploy our unmanaged solution from our development system as a managed solution to our production system, as we do regularly.

We are now getting a deployment failure: the deployment rolls back. I download the deployment report: It shows that all entities and diagrams are deployed and that the dashboards (next item on the list) were not started. No issue is shown.

Then I run a trace on the server. It shows a "duplicate key" exception: "inserted element already exists". But there is no real indication which record is causing the conflict.

Crm Exception: Message: Import failed, ErrorCode: -2147188706, InnerException: System.ArgumentException: Ein Element mit dem gleichen Schlüssel wurde bereits hinzugefügt.
   bei System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   bei Microsoft.Crm.Tools.ImportExportPublish.IgnoreCustomizedReportsTreeInNonOverwriteMode.FindExistingRelations(XmlNodeList reports, Guid solutionId)
   bei Microsoft.Crm.Tools.ImportExportPublish.IgnoreCustomizedReportsTreeInNonOverwriteMode.Execute(IXPathNavigable reportsRoot, ExecutionContext context)
   bei Microsoft.Crm.Tools.ImportExportPublish.ReportPreImportHandler.ExecutePreImportSteps(XmlNode reportsNode, ExecutionContext context)
   bei Microsoft.Crm.Tools.ImportExportPublish.ImportReportsHandler.ImportItem()
   bei Microsoft.Crm.Tools.ImportExportPublish.ImportHandler.Import()
   bei Microsoft.Crm.Tools.ImportExportPublish.RootImportHandler.ImportAndUpdateProgress(ImportHandler ih)
   bei Microsoft.Crm.Tools.ImportExportPublish.RootImportHandler.ProcessMetadataHandlers(String[] ImportEntities, Hashtable ht, String& curPath, ImportHandler& ihForCurrentPath, CounterList listCounters)
   bei Microsoft.Crm.Tools.ImportExportPublish.RootImportHandler.RunImport(String[] ImportEntities)

Question: How do other programmers hunt this kind of issue?

It is an on-premise installation.


Solution

  • We solved the issue. For an unknown reason we had all Dynamics standard reports twice in our solution. They are also now present twice on the development system. Since those are managed reports, we can't delete them from the development system. But we removed them from the solution. Now deployment is working again.

    There are still some open questions: a) Why are the reports present twice on the dev system and in the solution? b) Why is it a problem to import the reports twice to the prod system when they obviously coexist in the dev system.