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

Article:TECH196837  |  Created: 2012-09-18  |  Updated: 2012-09-18  |  Article URL http://www.symantec.com/docs/TECH196837
Article Type
Technical Solution


Environment

Issue



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


Error



"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"


Environment



ITMS 7.1 Sp2


Cause



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


Solution



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.




Article URL http://www.symantec.com/docs/TECH196837


Terms of use for this information are found in Legal Notices