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
Daniel KDaniel K 

Apex Batch Job Failed during Preparing State

Hi All,
           Mentioned Apex Batch Job has failed in "Preparing" state itself.

           Can you please help me in identifying potential cause for this error: 
            1) Is it during query execution  OR
            2) because of looping in the execute method ?

Thanks
D
Pradeep SinghPradeep Singh
Hi Daniel,
If its giving error in preparing stage then the error is in the start method/query. Can you please post the error message.!
Daniel KDaniel K
Thanks for your response.

Found below in Apex Jobs, I was monitoring the batch job exection by clicking on refresh in "Apex Jobs"  screen and noticed that Status changed from "Preparing" to "Failed"

Job Type : Batch Apex     
Status  : Failed          
Status Detail : First error: Apex CPU time limit exceeded
Total Batches : 0
Batches Processed : 0
Failures : 0
 
Daniel KDaniel K
sorry..previously I gave wrong info:

Job Type : Batch Apex     
Status  : Failed          
Status Detail : First error: Apex CPU time limit exceeded
Total Batches : 0
Batches Processed : 1
Failures : 1