# Task Agent issues

**URL:** <https://www.epiusers.help/t/task-agent-issues/47049>\
**Category:** Epicor ERP 10\
**Created:** [August 20, 2018, 3:10pm UTC](https://www.epiusers.help/t/task-agent-issues/47049 "2018-08-20T15:10:15Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Caleb323](https://www.epiusers.help/letter_avatar_proxy/v4/letter/c/7c8e57/32.png) [@Caleb323](https://www.epiusers.help/u/Caleb323)\
**Post date:** [August 20, 2018, 3:10pm UTC](https://www.epiusers.help/t/task-agent-issues/47049/1 "2018-08-20T15:10:15Z")

</div>

It seems like every night we have a SQL job scheduled the Epicor Task Agent gets hosed up and stops working.

I’ve had to disable the job since I get a call every night about the task agent not spitting out the reports.

We print out a BAQ report around 100-200 times an hour and so when the task agent starts running into problems, we lose out on a chunk of time where the report isn’t being ran / printed.

The issue is that the report goes into either the Scheduled Tasks as an “Immediate run request” or it goes into the Active Tasks as “PENDING” and just stays there… When I remote in and go to fix the issue I usually have to clear out all these pending tasks and the immediate run request tasks and then either restart the Task Agent service itself - or just the Production Environment task agent.

Has anyone else had issues like this before? I’m not sure why SQL jobs would cause issues with the Task Agent at all, but even now that the jobs are disabled the tasks still get hung up at least twice a week. Any ideas?

---

<div class="post-metadata">

**Author:** ![John\_Mitchell](https://www.epiusers.help/user_avatar/www.epiusers.help/john_mitchell/32/718_2.png) [@John\_Mitchell](https://www.epiusers.help/u/John_Mitchell)\
**Post date:** [August 20, 2018, 3:18pm UTC](https://www.epiusers.help/t/task-agent-issues/47049/2 "2018-08-20T15:18:49Z")

</div>

What’s the SQL job that you are running? Also, can you make it happen if you manually run the job as opposed to the scheduler?

---

<div class="post-metadata">

**Author:** ![Caleb323](https://www.epiusers.help/letter_avatar_proxy/v4/letter/c/7c8e57/32.png) [@Caleb323](https://www.epiusers.help/u/Caleb323)\
**Post date:** [August 20, 2018, 3:25pm UTC](https://www.epiusers.help/t/task-agent-issues/47049/3 "2018-08-20T15:25:00Z")

</div>

During a time that production isn’t running I bet we could manually get the issue to occur just by running the SQL job and trying to run the same amount of BAQ reports that is usually ran…  
Here’s the job information:  
It’s part of the Daily Maintenance plan

 ![image](https://epiusers.help/uploads/default/original/2X/e/e6d9efacf827841f428131125b7ba47604f245ba.png)

It’s just puzzling that the task agent runs into issues whenever SQL starts running something…

---

<div class="post-metadata">

**Author:** ![aidacra](https://www.epiusers.help/user_avatar/www.epiusers.help/aidacra/32/17997_2.png) [@aidacra](https://www.epiusers.help/u/aidacra)\
**Post date:** [August 20, 2018, 4:00pm UTC](https://www.epiusers.help/t/task-agent-issues/47049/5 "2018-08-20T16:00:47Z")

</div>

The SQL job is blocking a SQL object that the task agent processing needs. Don’t use the built-in SQL Wizard options for index/stats maintenance as it is overkill. I’d recommend implementing the Ola Hallengren index maintenance script as it only maintains those indexes/stats when it is needed based on the thresholds you set.

> **[SQL Server Index and Statistics Maintenance](https://ola.hallengren.com/sql-server-index-and-statistics-maintenance.html)**
>
> Award-Winning SQL Server Maintenance Solution for running index and statistics maintenance in SQL Server 2008, 2008 R2, 2012, 2014, 2016, 2017, and 2019

> **[Reindex](https://www.epiusers.help/t/reindex/38046/7)**
>
> Are you rebuilding all indexes in your database every time? If so, I’d recommend looking into only rebuilding the indexes that actually need it which could save a lot of time (and if you have your SQL data files on SSDs, some wear and tear on...

---

<div class="post-metadata">

**Author:** ![John\_Mitchell](https://www.epiusers.help/user_avatar/www.epiusers.help/john_mitchell/32/718_2.png) [@John\_Mitchell](https://www.epiusers.help/u/John_Mitchell)\
**Post date:** [August 20, 2018, 4:19pm UTC](https://www.epiusers.help/t/task-agent-issues/47049/6 "2018-08-20T16:19:03Z")

</div>

A Reorganization is online and non-blocking and it’s most likely the Update Stats Fullscan, that being said definitely use a script to intelligently only reorganize the indexes that need it.

---

<div class="post-metadata">

**Author:** ![Kimberley](https://www.epiusers.help/user_avatar/www.epiusers.help/kimberley/32/50847_2.png) [@Kimberley](https://www.epiusers.help/u/Kimberley)\
**Post date:** [August 21, 2018, 12:24pm UTC](https://www.epiusers.help/t/task-agent-issues/47049/7 "2018-08-21T12:24:15Z")

</div>

Just a side note. You should not need to delete out the jobs stuck in immediate run or pending. When you restart the Task Agent it should kick them off and start to print out.
