Error while updating target membership. An item with the same key has already been added.
search cancel

Error while updating target membership. An item with the same key has already been added.

book

Article ID: 157055

calendar_today

Updated On:

Products

IT Management Suite

Issue/Introduction

Error while updating target membership. An item with the same key has already been added.

"Unhandled exception.  Type=System.ArgumentException Msg=An item with the same key has already been added.
StackTrace=
   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 Altiris.NS.ItemManagement.DelayLoad.DelayLoadCollection`1.Add(Guid key)
   at Altiris.NS.StandardItems.Targeting.ResourceTarget.CalculateRows(String trusteeList, Boolean bWithDelayLoad)
   at Altiris.NS.StandardItems.Targeting.ResourceTarget.Evaluate2()
   at Altiris.NS.UI.DataProviders.ResourceTargetBuilderGridProvider.GetGridData(String id)
   at Altiris.WebControls.GridControl.GetDataSource()
   at Altiris.WebControls.GridControl.Grid_BeforeCallback(Object sender, EventArgs e)
   at ComponentArt.Web.UI.Grid.OnLoad(EventArgs oArgs)
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
"global.asax","w3wp"

Cause

The same computer is part of both rm_resourcecomputer and rm_resourceVirtualMachine resource types.
 

Resolution

1. First perform a full backup of the Symantec_CMDB database.

2. Run the following query to find the problematic computer(s):

select RM.guid
, RM.Name
from RM_ResourceComputer rm
where exists
(select rv.Guid from RM_ResourceVirtual_Machine rv where RM.guid = rv.Guid)

3. Delete the Computer resource with both Computer and Virtual Machine resource types via the SMP Console.


Applies To

ITMS 7.1 Sp2