Fortunately, there are a number of steps one can take to cancel or complete a stuck task.
When troubleshooting a stuck task in Epicor, look to address it in the following order:
- Cancel the task in the System monitor
- Bounce the Task Agent
- Bounce the AppServer instance
- Update the rogue SysTask record directly in SQL
Cancel the Task in the Epicor System Monitor
The simplest way to kill a task is using the Epicor System Monitor itself. This can be done by navigating to the “Active Tasks” tab, selecting the task you intend to cancel and clicking the delete (“X”) icon. If successful, this task will fall out of the “Active Tasks” queue and fall into the “History Tasks” queue as a task with a status of “Cancelled”:
Bounce the Task Agent
If the task will not cancel through the System Monitor, you can try to bounce the Task Agent itself, which may free up the task and allow it to cancel. This is a relatively noninvasive method and will generally go unnoticed by the user community. From the AppServer, launch the Epicor Administration console, and from the Admin console, launch the Task Agent Configuration utility. Select the task agent you wish to cancel and from the “Actions” menu, select “Stop Agent…”:
Bounce the AppServer Instance
If a Task Agent bounce is ineffective, bouncing the AppServer itself may work. This is a much more invasive solution, so it should be done when the user load is low, or else at a prescribed time such that the user community will be prepared. From the Admin Console, navigate to the server you wish to bounce, right-click the server node and select “Stop Application Pool.” Once stopped, right-click it again and select “Start Application Pool.” In my experience, this will normally shake loose the stuck task:
Update the rogue SysTask record directly in SQL
If all else fails, your last recourse is to update the SysTask record through SQL Server. Opening an instance of SQL Server Management Studio, navigate to the Database in question and create a new query. Enter the script below, adjusting the SysTaskNum to reflect the specific task number as found in the System Monitor. Run the query to update the record. While I am never a fan of direct SQL updates, this is one case in which such an update may be necessary.
update ice.SysTask set EndedOn = GetDate(), TaskStatus = ‘Complete’, History = 1 where SysTaskNum = 55228
delete ice.SysTaskKill where SysTaskNum = 55228
The Epicor System Monitor Lets You View, Manage and Cancel Tasks
At times, Epicor tasks need to be stopped. Hopefully, this article helped you understand the steps to take when trying to kill a task. This Epicor screen shows you which tasks are active, and it enables the initial steps for task resolution. You might even use this ERP feature daily. Due to its usefulness, the System Monitor is a classic. If your ERP system is a labyrinth, then your Epicor System Monitor is a golden thread, helping you navigate the maze and kill the wrongful task. As I’ve always said, it’s better to monitor than to minotaur…
For more ERP tricks from our Epicor consulting team, ask us for a case study on CTO and ETO implementations.
Or click here to watch our Epicor Summit to learn about Planning Workbench, SQL Server Administration, and SSRS Reports.