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

Patch Management - Disable Superseded Software Updates task. Error: An item with the same key has already been added.

book

Article ID: 225817

calendar_today

Updated On:

Products

Patch Management Solution

Issue/Introduction

PMimport task (subsequent sub-task) does not disable superseded updates.

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 RU4

Cause

Defect

Resolution

Attached there are two stored procedures with fix. See the attached files:

spPMCore_GetAllSupersededAdvertisements.sql

spPMCore_GetSupersedanceHierarchy.sql

Run them against the SMP database (NOTE: use of database name in first line of each procedure, change if necessary)

 

Attachments

1633941709724__spPMCore_GetSupersedanceHierarchy.sql get_app
1633941697619__spPMCore_GetAllSupersededAdvertisements.sql get_app