Skip to content
NewRedesigned blogFeedback
Jigar Karangiya

How to Reset Stuck Message Queue in Magento 2

Magento 2 uses a message queue system to handle asynchronous tasks like bulk operations, email sending, product reindexing, and more.

How to Reset Stuck Message Queue in Magento 2
Written by
JKJigar Karangiya
Published
Reading time
2 min read

Jigar Karangiya · · 2 min read

Magento 2 uses a message queue system to handle asynchronous tasks like bulk operations, email sending, product reindexing, and more. However, sometimes, messages get stuck due to a crash, deadlock, or improper consumer handling — clogging the queue and slowing down the system.

In this quick guide, we’ll show you how to reset the Magento 2 queue system safely by truncating the right tables in the database.

Caution: This is a destructive operation. Make sure to take a full DB backup before performing these steps on production.

Why Do Queues Get Stuck?

Queues may get stuck due to:

  • Consumers being stopped or crashed midway
  • Invalid payloads or corrupted data in queue messages
  • A long-pending bulk operation like product import or customer sync
  • Database deadlocks or locks on queue-related tables
  • Redis/MySQL failures during processing

Solution: Reset Stuck Queue in Magento 2

Here’s how you can truncate the queue-related tables to clear all stuck messages and restart fresh:

SQL Query to Reset Queues

sql
-- Disable foreign key checks
SET FOREIGN_KEY_CHECKS=0;
 
-- Truncate all queue-related tables
TRUNCATE TABLE queue;
TRUNCATE TABLE queue_message;
TRUNCATE TABLE queue_message_status;
TRUNCATE TABLE magento_operation;
TRUNCATE TABLE magento_bulk;
 
-- Re-enable foreign key checks
SET FOREIGN_KEY_CHECKS=1;

📌 These tables are responsible for storing queue messages, their status, and bulk operation logs.

When to Use This?

You should truncate these tables when:

  • Magento 2 Admin actions (bulk product update, reindex, etc.) are not completing
  • You see messages stuck in queue_message or magento_bulk table with status = new or status = running for hours
  • The message queue consumer is running but not processing anything
  • You’re resetting the staging/dev environment after a database copy from production

Restarting Consumers After Reset

Once the queue is truncated, restart the consumers to resume fresh processing:

RunTerminal
php bin/magento queue:consumers:start

Or for specific consumers (example):

RunTerminal
php bin/magento queue:consumers:start async.operations.all

Pro Tips

  • Always take a database backup before truncating tables.

  • You can check current stuck messages using:

    SELECT * FROM queue_message WHERE status = 'new';

  • Use queue:consumers:list to view available consumers.

Testing It Locally

In your local dev or staging , you can simulate a bulk import or reindex to see how the queue processes messages. If something fails, try the above reset to test how it behaves afterward.

Conclusion

Magento 2’s queue system is powerful but can occasionally hang due to background failures. By safely truncating queue-related tables and restarting consumers, you can unstick your Magento 2 instance without a full reset or reinstallation.

Have you encountered queue issues in production? Share your experience in the comments, or feel free to reach out for more advanced debugging techniques!

Keep reading
All posts

01 · 10 min · Shares Adobe Commerce Core

Adobe Commerce Agentic Capabilities, Q4 2026

Five agentic releases for Adobe Commerce: LLM product discovery, Brand Visibility, the Shopper MCP server, Brand Concierge, and Experience Workspace. What each one does, which editions get it, and when.

10 min

03 · 3 min · Shares Adobe Commerce Core

Conditions for Collections in Magento 2

Collections in Magento 2 (Now Adobe Commerce), are among the most powerful tools for retrieving and manipulating data directly from the database.

3 min

Newsletter

New Magento tutorials, straight to your inbox

Code examples, performance tips, and fixes for common Magento issues. No spam.

Subscribe