AWS SQS AWS.SimpleQueueService.QueueDeletedRecently

The queue was recently deleted and cannot be recreated immediately.

Understanding AWS SQS

Amazon Simple Queue Service (SQS) is a fully managed message queuing service that enables you to decouple and scale microservices, distributed systems, and serverless applications. SQS eliminates the complexity and overhead associated with managing and operating message-oriented middleware, and empowers developers to focus on differentiating work.

Identifying the Symptom

When working with AWS SQS, you might encounter the error code AWS.SimpleQueueService.QueueDeletedRecently. This error typically occurs when you attempt to recreate a queue that was recently deleted.

What You Observe

Upon trying to create a queue with the same name as one that was recently deleted, the operation fails, and you receive the error message indicating that the queue was deleted recently.

Details About the Issue

The error code AWS.SimpleQueueService.QueueDeletedRecently is a common issue faced by developers using AWS SQS. This error occurs because AWS imposes a restriction on recreating a queue with the same name immediately after deletion. This is to prevent accidental recreation of queues that might lead to data loss or other unintended consequences.

Why This Happens

When a queue is deleted, AWS SQS retains the queue metadata for a short period (usually around 60 seconds) to ensure that any in-flight messages are properly handled and to prevent accidental recreation of the queue.

Steps to Fix the Issue

To resolve the AWS.SimpleQueueService.QueueDeletedRecently error, follow these steps:

Step 1: Wait Before Recreating

The simplest solution is to wait for at least 60 seconds after deleting a queue before attempting to recreate it. This waiting period allows AWS SQS to fully process the deletion and clear the queue metadata.

Step 2: Verify Queue Deletion

Ensure that the queue has been completely deleted by listing all queues and confirming that the desired queue name is not present. You can use the AWS CLI command:

aws sqs list-queues

Step 3: Recreate the Queue

Once the waiting period has elapsed, you can proceed to recreate the queue using the AWS Management Console, AWS CLI, or SDKs. For example, using the AWS CLI:

aws sqs create-queue --queue-name MyQueue

Additional Resources

For more information on managing queues in AWS SQS, refer to the official AWS SQS Developer Guide. You can also explore the AWS SQS FAQs for common questions and answers related to queue management.

Never debug

AWS SQS

manually again

Let Dr. Droid create custom investigation plans for your infrastructure.

Book Demo
Automate Debugging for
AWS SQS
See how Dr. Droid creates investigation plans for your infrastructure.

MORE ISSUES

Made with ❤️ in Bangalore & San Francisco 🏢

Doctor Droid