Hi All,
While upgrading the database model for R3 CU11, i am getting following error in DynamicsSetupLog
Calling AxUtil to import model file "C:\PROGRAMDATA\MICROSOFT\DYNAMICS AX\PACKAGE\2016-08-29 13-44-31\GRANULARMODELS\DYNAMICSAX2012R3_CL4568824.AXMODEL".
Error updating model database: System.ArgumentException: An item with the same key has already been added.
at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
at System.Collections.ObjectModel.KeyedCollection`2.AddKey(TKey key, TItem item)
at System.Collections.ObjectModel.KeyedCollection`2.InsertItem(Int32 index, TItem item)
at System.Collections.ObjectModel.Collection`1.Add(T item)
at Microsoft.Dynamics.AX.Framework.Tools.ModelManagement.PermissionGraph.AddSecurityConstruct(SecurityConstruct group)
at Microsoft.Dynamics.AX.Framework.Tools.ModelManagement.ModelPermissionLoader.LoadPermissions()
at Microsoft.Dynamics.AX.Framework.Tools.ModelManagement.PermissionCacheManager.TruncateAndBuildCaches(AxUtilConfiguration config, String schema, SqlConnection connection, SqlTransaction transaction)
at Microsoft.Dynamics.AX.Framework.Tools.ModelManagement.ModelImport.ModelImportReader.Import()
at Microsoft.Dynamics.AX.Framework.Tools.ModelManagement.ModelImport.ModelImportReader.Import()
at Microsoft.Dynamics.AX.Framework.Tools.ModelManagement.AxUtil.Import(Boolean verbose, Nullable`1 conflictTargetLayer)
at Microsoft.Dynamics.AX.Framework.Tools.ModelManagement.AxUtil.Import(AxUtilContext utilContext, AxUtilConfiguration utilConfig, Boolean verbose)
at Microsoft.Dynamics.Setup.DatabaseSqlModel.DatabaseSqlModelInstanceCommon.ImportModelFiles(IEnumerable`1 filenames, IEnumerable`1 modelsToReplace)
at Microsoft.Dynamics.Setup.DatabaseSqlModel.DatabaseSqlModelInstanceUpdate.Execute()
Does any one have any clue?
*This post is locked for comments
You mean, i should have criteria like below
AND r1element.Name = r3element.Name
AND r1element.AxId <> r3element.AxId
Have you customized the select statements for your requirements? Mine is looking for objects which have different name, but same element handle, due to Microsoft renaming them between versions (i.e. got deprecated, so they are now using a DEL_ prefix). In your case it is the other way around, the name is the same, but element handlers are different maybe? The answer will be in those modelelement* tables, you need to customize the statement as per your needs, since I have no way reproducing the issue.
Hi Vilmos,
I tried as per your suggestion. Created a new Database for AX setup, and using queries provided on your blog compare the new database and the prelive database, both returns zero record.
Sorry your solution did not work.
The solution is above, import the model to an environment without customization, then compare the databases.
This is annoying. I tried to Install model manually and getting the same message on the power shell.
PS C:\Windows\system32> Install-AXModel -File "C:\ProgramData\Microsoft\Dynamics
AX\Package\2016-08-30 21-42-40\GranularModels\DynamicsAX2012R3_CL4307967.axmode
l" -Database Prelive_model -Server DB-Details
Install-AXModel : The pipeline has been stopped.
At line:1 char:16
+ Install-AXModel <<<< -File "C:\ProgramData\Microsoft\Dynamics AX\Package\201
6-08-30 21-42-40\GranularModels\DynamicsAX2012R3_CL4307967.axmodel" -Database H
ydraAX2012R3_Prelive_model -Server CPT-AXDB02 -Details
+ CategoryInfo : OperationStopped: (:) [Install-AXModel], Pipelin
eStoppedException
+ FullyQualifiedErrorId : An item with the same key has already been added
.,Microsoft.Dynamics.AX.Framework.Tools.ModelManagement.PowerShell.Install
AXModelCommand
It is something related to new ID generation. How can we refresh the ID generation.
Hi,
Is there any other way.
I tried selecting only one feature when choosing the model store to be updated, still it says the same error.
That is the model that the installer is trying to deploy, not the one you have.
You could try to install the CU on a separate environment which has no customizations. Then add your target server where you originally wanted to install the CU as a Linked Server in the updated environment, and from there it is just a matter of comparing the two ModelElement / ModelElementData tables to see which of your customizations are holding the same ID or name which are causing the conflict. I have blogged about comparing modelstores here:
www.daxrunbase.com/.../modified-objects-two-ax-2012-databases
How can we find which model is causing issue. it mention in the log that CL4568824, but that is not installed in the current model we have.
Any help would be highly appreciated
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,188 Super User 2024 Season 2
Martin Dráb 230,030 Most Valuable Professional
nmaenpaa 101,156