What is a good way to delete a stuck batch in Drupal 7?

It is on a production server, we are using the Background Batch module so it shows us which one it is at admin/config/system/batch/overview.enter image description here

I know I can just run a query and delete that row from the DB but wondering about other cleanup I should do too.


Another approach (if you don't want to run sql-statements directly) would be Queue UI:

  • View queues and number of items
  • Developers can define meta info about queues they create and process
  • Process queue with Batch API
  • Process queue during cron
  • Remove leases
  • Delete queue

enter image description here

|improve this answer|||||
  • Thanks, was looking for something quick and easy to run on a production server without committing new code. Does this delete batches though or just queues? – Elijah Lynn Jun 24 '16 at 17:33
  • 1
    batches are treated as queues, so yes. – Andre Baumeier Jun 28 '16 at 16:14

In my case the batch ID is 5166:

DELETE FROM batch WHERE bid IN (5166);

In our case we are using Better Batch and we also needed to run:

DELETE FROM better_batch WHERE bid IN (5166); otherwise we received an infinite redirect message in Chrome "too many redirects".

source: https://www.drupal.org/node/1627850#comment-6142774

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.