Salesforce Apex batch jobs may become stuck in a "Holding" or "Queued" status and stop executing. When this happens, all submitted batch jobs stop running and none progress to completion. This typically occurs when there is a stalled system token job in the Apex job queue with a JobType of "ApexToken" that is blocking the queue.
This article explains how to diagnose whether the issue is a platform-level problem requiring Salesforce Support intervention, and how to resolve it if it is not.
First, determine whether the batch job queue is blocked by a stalled system ApexToken job. Run the following query using the Developer Console or Workbench:
Query the AsyncApexJob object where JobType equals 'ApexToken' and Status equals 'Queued'. In SOQL: SELECT Id, CreatedDate FROM AsyncApexJob WHERE JobType='ApexToken' AND Status='Queued'
If records are returned: This indicates a platform-level issue. Log a case with Salesforce Support and provide the query results. Do not proceed to Step 2.
If no records are returned: The queue blockage is not caused by an ApexToken job. Proceed to Step 2.
If the ApexToken query returns no records, follow these steps to manually abort all stuck jobs:
You must use API version 31 for the abort script. If you run the abort script using a newer API version, you will receive the following error:
System.StringException: You can't abort scheduled apex jobs by calling System.abortjob() with an AsyncApexJob ID. You must call System.abortjob with the parent CronTrigger ID.
This error does not occur when using API version 31. Always change the API version to 31 before executing the abort script in Workbench.
000381767

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.