While running 'Import Patch Data for Windows' using the 'Delete' and 'Incremental' options, PMImport fails with an 'Unknown exception was thrown' on the screen.
The NS logs only show the error listed below:
Module: AtrsHost.exe
Source: PMC:PMResourceImportTask.OnExecuteSingleton
Description: Unable to cast object of type 'Altiris.SoftwareManagement.Resources.SoftwareUpdateResource' to type 'Altiris.PatchManagementCore.Resources.PatchSoftwareUpdateResource'.
[System.InvalidCastException, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]
at Altiris.PatchManagementCore.Tasks.Server.PMResourceImportTask.RemoveSWUpdatesBasedOnExcludedSWReleases()
at Altiris.PatchManagementCore.Tasks.Server.PMResourceImportTask.ExecuteTask(IServerTaskExecutionInstance instance)
at Altiris.PatchManagementCore.Tasks.Server.PMResourceImportTask.OnExecuteSingleton(IServerTaskExecutionInstance i)
ITMS 8.x
Patch Management Solution 8.x
Wrong associations were created in the database for some Patch Resources
Work through the following troubleshooting steps:
select i.Name, c.Type, i.*
from vItem i
join Class c on c.Guid = i.ClassGuid
where c.Type like '%SoftwareUpdateResource%'
order by 2,1
This will display items associated to 'Altiris.PatchManagementCore.Resources.PatchSoftwareUpdateResource' and 'Altiris.SoftwareManagement.Resources.SoftwareUpdateResource'
Note: The items that are associated to 'Altiris.SoftwareManagement.Resources.SoftwareUpdateResource' will need to be deleted
CAUTION: Found one case where items returned for the bad '...SoftwareUpdateResource' were not specific to Patch Management, for there was corrupt Software Management Jobs that were hanging the process as it executed to update those associations. Worked through the following and it resolved the issue, but the individual Software Management Jobs had to be cleaned up separately, and some of them had to be deleted from the 'ItemResource' table in the database directly due to associations failing to clear.
Work through the following to delete the bad '...SoftwareUpdateResource' associations: