Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

AX 2012 R3 CU11 upgrade error

(0) ShareShare
ReportReport
Posted on by 725

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

  • RE: AX 2012 R3 CU11 upgrade error

    You mean, i should have criteria like below

    AND r1element.Name = r3element.Name

    AND r1element.AxId <> r3element.AxId

  • Vilmos Kintera Profile Picture
    Vilmos Kintera 46,149 on at
    RE: AX 2012 R3 CU11 upgrade error

    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.

  • RE: AX 2012 R3 CU11 upgrade error

    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.

  • Vilmos Kintera Profile Picture
    Vilmos Kintera 46,149 on at
    RE: AX 2012 R3 CU11 upgrade error

    The solution is above, import the model to an environment without customization, then compare the databases.

  • RE: AX 2012 R3 CU11 upgrade error

    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.

  • RE: AX 2012 R3 CU11 upgrade error

    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.

  • Vilmos Kintera Profile Picture
    Vilmos Kintera 46,149 on at
    RE: AX 2012 R3 CU11 upgrade 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

  • RE: AX 2012 R3 CU11 upgrade error

    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.

  • RE: AX 2012 R3 CU11 upgrade error

    Any help would be highly appreciated

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,391 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,445 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans