function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
ChopaForceChopaForce 

Scheduled Apex Job - aborted

Hello,

 

about a year ago, I coded a batchable class that is scheduled to run every night. The number of batches is about 2500.

I've noticed that sometimes, the apex job status is set to "Aborted" after completing 20% of his job. I was wondering if there's any reason / factor I could look for to find out why the job is being aborted.  Please note that I did not receive any "System Exception" email from salesforce.

 

Thank you,

 

Chopa

 

Anup JadhavAnup Jadhav

Try enabling debug logs and check the logs. Ofcourse add some system.debug statements in the batch job to monitor it.

 

Thanks,

Anup

tggagnetggagne
We're experiencing a similar problem. 

Just today a job that's been running at 6AM all week has suddenly started aborting during the prepare.  The debug log's last line is the SOQL_EXECUTE_BEGIN.  Nothing after that.

When our administrator tries the same select as the job in the query editor he get's a "communication failure."

We've opened a ticket with Salesforce.
Admin User 715Admin User 715

We also have experienced a similar problem, we have randomly batches aborted, and we dont understand why. Anyone can explain which causes can produce those problems, is a salesforce bug or we need to optimize anything... Anyone can help

Thnks,

Klodjan

tggagnetggagne
The answer seemed to be the SOQL took too long to execute.  Maddening, really.  Not sure why it runs fine some days and not others.