Error: "An item with the same key has already been added" when Disable Superseded Software Updates task in Patch Management
search cancel

Error: "An item with the same key has already been added" when Disable Superseded Software Updates task in Patch Management

book

Article ID: 225817

calendar_today

Updated On: 06-16-2025

Products

Patch Management Solution

Issue/Introduction

PMimport task (subsequent sub-task) does not disable superseded updates and returns error:

9/28/2021 2:19:54 PM (AtrsHost) Altiris.PatchManagementCore.Tasks.Server.DisableSupersededUpdateTask.ExecuteTask

 

Patch Management Import Resources task exception

An item with the same key has already been added.
[System.ArgumentException @ mscorlib]
at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer)
at Altiris.PatchManagementCore.Tasks.Server.DisableSupersededUpdateTask.GetParentPoliciesForSupersededUpdates(DateTime limitDate)
at Altiris.PatchManagementCore.Tasks.Server.DisableSupersededUpdateTask.GetItemsForCleanup()
at Altiris.PatchManagementCore.Tasks.Server.DisableSupersededUpdateTask.CleanupSupersededAdvertisements()
at Altiris.PatchManagementCore.Tasks.Server.DisableSupersededUpdateTask.DisableSupersededSoftwareUpdateTasksTask()
at Altiris.PatchManagementCore.Tasks.Server.DisableSupersededUpdateTask.ExecuteTask()

Exception logged from:
at Altiris.PatchManagementCore.Tasks.Server.DisableSupersededUpdateTask.ExecuteTask()
at Altiris.PatchManagementCore.Tasks.Server.DisableSupersededUpdateTask.OnExecuteSingleton(Altiris.TaskManagement.ServerTasks.IServerTaskExecutionInstance)
at Altiris.PatchManagementCore.Tasks.Server.SerializingBaseSingletonServerTask<TContent,TControl>.OnExecute(Altiris.TaskManagement.ServerTasks.IServerTaskExecutionInstance)
at Altiris.TaskManagement.SingletonTask.SingletonTaskContext.Execute(Altiris.TaskManagement.IBaseTask, System.Func<Altiris.TaskManagement.ServerTasks.IServerTaskExecutionInstance,Altiris.TaskManagement.Common.Execution.ExecutionResult>, Altiris.TaskManagement.ServerTasks.IServerTaskExecutionInstance)

Environment

ITMS 8.5

Patch Management 8.5

Cause

Defect

Resolution

Attached are two stored procedures with a fix and those affected are listed here:

spPMCore_GetAllSupersededAdvertisements.sql

spPMCore_GetSupersedanceHierarchy.sql

Run the attached stored procedures against the SMP database.

NOTE: Use of your database name in first line of each procedure is critical so change if necessary.

Attachments

1633941709724__spPMCore_GetSupersedanceHierarchy.sql get_app
1633941697619__spPMCore_GetAllSupersededAdvertisements.sql get_app