Error: At least one instance of the task task '<Task Name>' (<GUID>) is running and cannot be deleted
search cancel

Error: At least one instance of the task task '<Task Name>' (<GUID>) is running and cannot be deleted

book

Article ID: 249037

calendar_today

Updated On:

Products

Client Management Suite IT Management Suite

Issue/Introduction

Unable to delete a Quick Delivery task, the right-click option to "Delete" is missing in the SMP Console and there is no task history for the task. When trying to force the deletion by adding it to the ItemsToDelete table the following Errors/Warnings are seen in the logs:

Severity: 1
Date: 8/26/2022 12:00:01 PM
Tick Count: 273596671
Host Name: <NS server>
Process: AeXSvc (11824)
Thread: 170
Module: Altiris.NS.dll
Source: Item.Delete
Description: Failed to delete item: 6754e28b-d392-4135-99bb-cc3c3328d8a7

At least one instance of the task task '<Task Name>' (6754e28b-d392-4135-99bb-cc3c3328d8a7) is running and cannot be deleted. You can delete the task after it has completed or stop it manually and try again.
   [System.Exception @ Altiris.TaskManagement]
   at Altiris.TaskManagement.VersionItem.OnPreDelete()
   at Altiris.NS.ItemManagement.Item.Delete()Severity: 1

 

Severity: 2
Date: 8/26/2022 12:00:01 PM
Tick Count: 273596671
Host Name: <NS server>
Process: AeXSvc (11824)
Thread: 170
Module: Altiris.NS.dll
Source: Altiris.NS.ItemManagement.ItemToDeleteSchedule.DeleteItems
Description: Unable to delete the specified item: 6754e28b-d392-4135-99bb-cc3c3328d8a7

Failed to delete item: 6754e28b-d392-4135-99bb-cc3c3328d8a7
   [Altiris.NS.Exceptions.AeXException @ Altiris.NS]
   at Altiris.NS.ItemManagement.Item.Delete()
   at Altiris.NS.ItemManagement.Item.<>c__DisplayClass407_0.<DeleteItem>b__0(IDatabaseContext ctx)
   at Altiris.NS.ContextManagement.AdminDatabaseContext.<>c__DisplayClass31_0`1.<PerformWithDeadlockRetry>b__0(IDatabaseContext ctx)
   at Altiris.Database.DatabaseContext`1.RetryActionRequest.Perform(Boolean throwIfRetriedOut)
   at Altiris.Database.DatabaseContext`1.PerformWithDeadlockRetryHelper(Int32 retries, Int32 retryDelay, Boolean outerTransaction, Getter`1 getContext, Action`1 action, Action`1 retry, Boolean selfTransaction, String deadlockMessage, String category)
   at Altiris.NS.ItemManagement.Item.DeleteItem(Guid itemGuid, ItemLoadFlags flags, Boolean forceKill)
   at Altiris.NS.ItemManagement.ItemToDeleteSchedule.DeleteItems()

At least one instance of the task task '<Task Name>' (6754e28b-d392-4135-99bb-cc3c3328d8a7) is running and cannot be deleted. You can delete the task after it has completed or stop it manually and try again.

Environment

ITMS 8.6

Cause

The task history was no longer available and this task didn't show as being completed in the TaskInstancesComplete table

Resolution

Checked both the TaskInstancesComplete and TaskInstancesIncomplete table.  Deleted this task from the TaskInstancesComplete table and then was able to right-click > Delete the task from the SMP Console.

Additional Information

171823 Find all tables that contain a specific GUID