AWS SQS AWS.SimpleQueueService.QueueDeletedRecently error encountered when attempting to recreate a queue.

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 attempting to create a new queue with the same name as a recently deleted one, the operation fails, and you receive the error message: AWS.SimpleQueueService.QueueDeletedRecently.

Explaining the Issue

The AWS.SimpleQueueService.QueueDeletedRecently error indicates that AWS SQS has a restriction on immediately recreating a queue with the same name after it has been deleted. This is a protective measure to ensure data consistency and to prevent accidental data loss.

Why This Happens

When a queue is deleted, AWS SQS retains the queue's metadata for a short period to prevent accidental recreation that might lead to data inconsistency or loss. This retention period is typically around 60 seconds.

Steps to Fix the Issue

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

Step 1: Wait for the Retention Period

After deleting a queue, wait for at least 60 seconds before attempting to recreate it. This waiting period allows AWS SQS to clear the metadata of the deleted queue.

Step 2: Verify Queue Deletion

Ensure that the queue has been successfully deleted. You can verify this by listing all queues and checking that the queue name no longer appears in the list. Use the following AWS CLI command:

aws sqs list-queues

Step 3: Recreate the Queue

Once the retention period has passed, attempt to recreate the queue using the AWS Management Console, AWS CLI, or SDKs. For example, using the AWS CLI, you can run:

aws sqs create-queue --queue-name MyQueue

Additional Resources

For more information on AWS SQS and managing queues, refer to the following resources:

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