AWS SQS AWS.SimpleQueueService.InvalidMessageRetentionPeriod

The message retention period is invalid.

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. It allows you to send, store, and receive messages between software components at any volume, without losing messages or requiring other services to be available.

Identifying the Symptom

When working with AWS SQS, you might encounter the error code AWS.SimpleQueueService.InvalidMessageRetentionPeriod. This error typically occurs when you attempt to set a message retention period that is outside the allowed range.

What You Observe

When this error occurs, you will see a message indicating that the message retention period is invalid. This can happen during the creation of a new queue or when updating the settings of an existing queue.

Details About the Issue

The AWS.SimpleQueueService.InvalidMessageRetentionPeriod error is triggered when the specified message retention period does not fall within the acceptable range. AWS SQS requires that the message retention period be set between 60 seconds (1 minute) and 1209600 seconds (14 days).

Why This Happens

This error is often due to a misconfiguration or a typo in the settings where the retention period is specified. It is crucial to ensure that the value is within the permissible limits to avoid this error.

Steps to Fix the Issue

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

Step 1: Verify the Retention Period

Check the current configuration of your SQS queue to ensure that the message retention period is set correctly. You can do this via the AWS Management Console or by using the AWS CLI.

aws sqs get-queue-attributes --queue-url --attribute-names MessageRetentionPeriod

Replace <your-queue-url> with the actual URL of your SQS queue.

Step 2: Update the Retention Period

If the retention period is incorrect, update it to a valid value. Use the AWS CLI to set a new retention period:

aws sqs set-queue-attributes --queue-url --attributes MessageRetentionPeriod=

Ensure that <valid-period-in-seconds> is between 60 and 1209600 seconds.

Step 3: Confirm the Changes

After updating, confirm that the changes have been applied successfully by retrieving the queue attributes again:

aws sqs get-queue-attributes --queue-url --attribute-names MessageRetentionPeriod

This should reflect the new, valid retention period.

Additional Resources

For more information on configuring AWS SQS, refer to the official AWS SQS Developer Guide. You can also explore the AWS SQS FAQs for common questions and answers.

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