Certain tasks will not load in the console, and the right click menu item will not open. They cannot be deleted by either right clicking on them or by adding them to the "Itemtodelete" table.
"Unable to get task details (*task guid*): Unable to load item *task guid* version -1
"Unable to delete the specified item (Item: {*task guid*}, Exception: Altiris.TaskManagement.Exceptions.ItemVersionNotFoundException: Unable to load item *task guid* version -1
ITMS 8.x
This can happen if there are no versions of a tasks. Use the following query to test for this condition.
select * from itemversions where itemguid = '*task guid*'
If this query comes back with no results, it means that your task has no versions, and that is why they can't be loaded or deleted. When clicking on a task, it tries to load the most recent version, but there are none to be found.
This can be resolved by temporarily giving a task a version so task can be deleted.
1. Create a new task of the same type and modify it a couple times and save changes each time. The name of this task doesn't matter, it will be deleted when this process is done.
2. Run the following query against CMDB database on your SQL server. This will map a version of your new task, to the corrupted tasks so it can be removed.
declare @broken as uniqueidentifier = 'Guid Of Broken Task'
declare @dummy as uniqueidentifier = 'Guid of Newly Created Task'
update ItemVersions
set itemguid = @broken
where VersionGuid in (
select top 1 versionguid
from ItemVersions
where ItemGuid = @dummy
)
insert
into ItemToDelete
values(@broken, getdate())
insert
into ItemToDelete
values(@dummy,getdate())
After running the above query, the corrupted task and the new task will be deleted the next time the "NSQuarter-hour" scheduled task run (within the next 15 min) on SMP server.
Please note! There is no way to recover the original task in this instance.
"Old Tasks will not Delete - no delete option in the right-click menu" (KB 172958 )