web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
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

I have the same question (0)
  • Syed Zeeshan Haider Jafry Profile Picture
    725 on at

    Any help would be highly appreciated

  • Syed Zeeshan Haider Jafry Profile Picture
    725 on at

    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.

  • Vilmos Kintera Profile Picture
    46,149 on at

    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

  • Syed Zeeshan Haider Jafry Profile Picture
    725 on at

    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.

  • Syed Zeeshan Haider Jafry Profile Picture
    725 on at

    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.

  • Vilmos Kintera Profile Picture
    46,149 on at

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

  • Syed Zeeshan Haider Jafry Profile Picture
    725 on at

    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
    46,149 on at

    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.

  • Syed Zeeshan Haider Jafry Profile Picture
    725 on at

    You mean, i should have criteria like below

    AND r1element.Name = r3element.Name

    AND r1element.AxId <> r3element.AxId

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

News and Announcements

Season of Giving Solutions is Here!

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
TAHER Mehdi Profile Picture

TAHER Mehdi 3

#1
TAHER Mehdi Profile Picture

TAHER Mehdi 3

#3
Nakul Profile Picture

Nakul 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans