The Symantec_CMDB dataBase grows fast, all tasks tables grow quickly, in the log viewer you see several of the following errors associated with the cleanup task:
Error deleting: Altiris.TaskManagement.Data.TaskExecutionInstanceNotFoundException: Unable to find task instance 00000000-0000-0000-0000-000000000000 in the database.
The above error is showing up several times a second in the a.log files, filling the logs. This error almost always shows up with two other errors, one of which indicates a Deadlock. However, the SQL server is showing no locking at all:
Process: AtrsHost (2068)
Module: AtrsHost.exe
Source: Altiris.TaskManagement.Data.AltirisSqlHelper.RepeatForDeadlocks
Description: AltirisSqlHelper.RepeatForDeadlocks(): Non-deadlock exception: Altiris.TaskManagement.Data.TaskExecutionInstanceNotFoundException: Unable to find task instance 00000000-0000-0000-0000-000000000000 in the database.
at Altiris.TaskManagement.Data.TaskExecutionInstance.GetTaskInstance(TaskInstanceGuid taskInstanceGuid)
at Altiris.TaskManagement.Data.TaskExecutionInstance.<>c__DisplayClass2.<DeleteTaskInstance>b__1(DatabaseContext ctx, Object state)
at Altiris.TaskManagement.Data.AltirisSqlHelper.RepeatForDeadlocks(Int32 retries, Int32 sleep, Object state, RepeatForDeadlocksDelegate func)
Process: AtrsHost (2068)
Module: AtrsHost.exe
Source: Altiris.TaskManagement.Data.AltirisSqlHelper.RepeatForDeadlocks
Description: AltirisSqlHelper.RepeatForDeadlocks(): Failed all retries
Process: AtrsHost (2068)
Module: AtrsHost.exe
Source: Altiris.TaskManagement.Maintenance.CleanupTaskDataTask.DeleteExcessWorkingData
Description: CleanupTaskDataTask.DeleteExcessWorkingData(): Error deleting: Altiris.TaskManagement.Data.TaskExecutionInstanceNotFoundException: Unable to find task instance 00000000-0000-0000-0000-000000000000 in the database.
at Altiris.TaskManagement.Data.TaskExecutionInstance.GetTaskInstance(TaskInstanceGuid taskInstanceGuid)
at Altiris.TaskManagement.Data.TaskExecutionInstance.<>c__DisplayClass2.<DeleteTaskInstance>b__1(DatabaseContext ctx, Object state)
at Altiris.TaskManagement.Data.AltirisSqlHelper.RepeatForDeadlocks(Int32 retries, Int32 sleep, Object state, RepeatForDeadlocksDelegate func)
at Altiris.TaskManagement.Data.TaskExecutionInstance.DeleteTaskInstance(TaskInstanceGuid taskInstanceGuid)
at Altiris.TaskManagement.Maintenance.CleanupTaskDataTask.DeleteExcessWorkingData(WaitHandle eventStop).
ITMS 8.x
This issue could be caused by the following two reasons:
1- Stop and change the Cleanup Task
2- Manually Delete the Data
If OBJECT_ID('TaskInstanceSummaries', N'U') is not nullTruncate table TaskInstanceSummariesIf OBJECT_ID('TaskInstanceResults', N'U') is not nullTruncate table TaskInstanceResultsIf OBJECT_ID('TaskInstances', N'U') is not nullTruncate table TaskInstances If OBJECT_ID('TaskInstancesCompleted', N'U') is not nullTruncate table TaskInstancesCompleted If OBJECT_ID('TaskInstancesIncomplete', N'U') is not nullTruncate table TaskInstancesIncompleteIf OBJECT_ID('TaskinstanceParents', N'U') is not nullTruncate table TaskinstanceParentsIf OBJECT_ID('TaskInstancesStarted', N'U') is not nullTruncate table TaskInstancesStartedIf OBJECT_ID('TaskInstanceStatus', N'U') is not nullTruncate table TaskInstanceStatusIf OBJECT_ID('TaskOutputPropertyValue', N'U') is not nullTruncate table TaskOutputPropertyValueIf OBJECT_ID('TaskInstanceEvents', N'U') is not nullTruncate table TaskInstanceEventsIf OBJECT_ID('TaskInstanceChildEvents', N'U') is not nullTruncate table TaskInstanceChildEvents If OBJECT_ID('TaskInstanceExecutionInfo', N'U') is not nullTruncate table TaskInstanceExecutionInfoIf OBJECT_ID('TaskInstanceJobNodes', N'U') is not nullTruncate table TaskInstanceJobNodesIf OBJECT_ID('TaskInstanceresultSummaries', N'U') is not nullTruncate table TaskInstanceresultSummariesIf OBJECT_ID('ServerTaskInstancerequests', N'U') is not nullTruncate table ServerTaskInstancerequestsIf OBJECT_ID('ClientTaskInstancerequests', N'U') is not nullTruncate table ClientTaskInstancerequestsIf OBJECT_ID('TaskOutputProperty', N'U') is not nullTruncate table TaskOutputPropertyREM Modify the run version if this script needs to be ran again on a machine that has already executed this script.REM This value is in place to prevent task loopingSet RunVer=1
REM Get the Altiris Agent install pathFOR /F "tokens=2*" %%A IN ('REG.EXE QUERY "HKLM\Software\Altiris\Altiris Agent" /V "installdir"') DO SET AgentDir=%%Bset tempbat=%temp%\AgentClean.bat"
FOR /F "tokens=2*" %%A IN ('REG.EXE QUERY "HKLM\Software\Altiris\Altiris Agent" /V "CleanupVer"') DO SET CleanupVer=%%Bif Ver%RunVer%==Ver%CleanupVer% exit
REM add Run value to registry to prevent looping incase task cannot report success to serverreg add "HKLM\Software\Altiris\Altiris Agent" /v CleanupVer /t REG_SZ /d %RunVer% /f
REM Create temporary batch file to execute while the agent restartsecho ping localhost -n 30 > %tempbat%echo "%AgentDir%\aexagentutil" /stop >> %tempbat%echo rmdir "%AgentDir%\TaskManagement" /s /q >> %tempbat%echo ping localhost -n 30 >> %tempbat%echo "%AgentDir%\aexagentutil" /start >> %tempbat%echo exit >> %tempbat%REM Executes temporary batch filestart "" /MIN %tempbat%
select max(i.name) as Name,TaskVersionGuid, count(*) As count from taskinstances tileft join itemversions ivon ti.TaskVersionguid = iv.Versionguidleft join item ion iv.Itemguid = i.guidjoin Taskinstanceresults tiron tir.TaskInstanceGuid = ti.TaskInstanceGuidwhere tir.endtime > getdate() -1group by TaskVersionGuidorder by count DESCdeclare @TaskVersionGuid uniqueidentifierset @TaskVersionGuid='XXXXXX-XXXXXXXX-XXXXXXXX'select max(vc.name) as Name, ResourceGuid, Count(*) as Count from TaskInstances tijoin vcomputer vcon ti.ResourceGuid = vc.Guidwhere ti.TaskVersionGuid = @TaskVersionGuidgroup by ResourceGuidorder by count DESC