1.1. Phantom Batch Processor Introduction
On rare occasions, a Batch Processor may get stuck in a processing status of Queued. This seems to occur when Salesforce has done upgrades.
Symptoms of this happening are when Payment Txn Status's get stuck in Receipting Complete Status and the Batch Processor status on the Merchant Facility is showing as running.
From version 7.7 onwards, an Error Log is created indicating this condition exists.
1.2. Check for duplicates
Before continuing with this procedure, first check to see if multiple processors are currently scheduled. If they are, you can simply stop those and all should be ok. If you are still observing issues or getting error reports after that, then continue with this procedure.
See procedure: How do I check for and cancel duplicate Batch Processors running?
1.4. Query Phantom Batch Processor Jobs from Developer Console
1.4.1. Open the Developer Console
- Top right click on the settings cog
- Followed by Developer Console
1.4.2. Run query on Batch Processors
- Click on the query tab.
- Paste “SELECT Id,Status,JobType,ApexClass.Name,CreatedDate,LastProcessed,JobItemsProcessed,NumberOfErrors FROM AsyncApexJob WHERE (JobType IN ('BatchApex','ScheduledApex') AND status IN ('Holding', 'Queued', 'Processing', 'Preparing') AND ApexClass.Name IN ('batchProcessor') AND ApexClass.NameSpacePrefix = 'AAkPay')” into the query
- Then press Execute
- Double click into the Id Cell. Copy the ID.
- NOTE, you will need to repeat Step Execute code to Abort Phantom Job for each row. NOTE Press the Execute (step 3) button each time Batch Processor Id's might change in the time it takes you to do the other steps.
SELECT Id,Status,JobType,ApexClass.Name,CreatedDate,LastProcessed,JobItemsProcessed,NumberOfErrors FROM AsyncApexJob WHERE (JobType IN ('BatchApex','ScheduledApex') AND status IN ('Holding', 'Queued', 'Processing', 'Preparing') AND ApexClass.Name IN ('batchProcessor') AND ApexClass.NameSpacePrefix = 'AAkPay')
1.5. Developer Workbench
1.5.1. Login to Developer Workbench
1.5.2. Select API Version 31
Click on the top link with the user + company + version No.
Select Version 31
1.5.3. Run Apex Code to Abort Phantom Jobs
- Select "Apex Execute" from the Utilities Menu
- Press Next button
1.5.3.1. Execute code to Abort Phantom Job
- Copy “system.abortjob('7074Q00007LyJwe'); “
- Change “7074Q00007LyJwe” to the id that was copied from Step 3 above.
- Press Execute
- Repeat for each Id in Step Run query on Batch Processors. NOTE, you should press the EXECUTE button (as in the Run query on Batch Processors step) again as the Id's might have changed in the time you've taken to do these updates. Continue to repeat until there are no Id's left from the query.
system.abortjob('7074Q00007LyJwe');
1.6. Restart Batch Processors
See procedure How do I start or stop the Batch Processor on how to START the Processors.