localstack icon indicating copy to clipboard operation
localstack copied to clipboard

bug: SQS SendMessage InvalidParameterValue DelaySeconds 0

Open ShedPlant opened this issue 1 year ago • 2 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Current Behavior

I have an application which uses SQS. It works in production. It has acceptance tests which were passing with localstack until very recently.

Now I see:

An error occurred (InvalidParameterValue) when calling the SendMessage operation: Value 0 for parameter DelaySeconds is invalid. Reason: The request include parameter that is not valid for this queue type.

Yes, delay 0 is being passed in to send_message but this used to work in both localstack and AWS.

https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/sqs.html#SQS.Client.send_message

DelaySeconds (integer) -- The length of time, in seconds, for which to delay a specific message. Valid values: 0 to 900.

Expected Behavior

DelaySeconds 0 is a valid value.

sqs send_message works when explicitly setting delay 0.

How are you starting LocalStack?

With a docker-compose file

Steps To Reproduce

How are you starting localstack (e.g., bin/localstack command, arguments, or docker-compose.yml)

docker run localstack/localstack

Client commands (e.g., AWS SDK code snippet, or sequence of "awslocal" commands)

  1. Create a SQS FIFO queue.
  2. Try to send_message, specifying DelaySeconds=0

Environment

- OS: macos
- LocalStack: latest

Anything else?

I notice on a recent issue that @thrau said he recently changed how SQS attribute values are validated.

ShedPlant avatar Aug 08 '22 14:08 ShedPlant

If I pin version in docker-compose.yml to 1.0.3, it works. latest, as of now, reproduces the issue.

ShedPlant avatar Aug 08 '22 14:08 ShedPlant

Possibly due to #6591

ShedPlant avatar Aug 08 '22 14:08 ShedPlant

Thanks @thrau ! Confirmed fixed.

ShedPlant avatar Aug 11 '22 08:08 ShedPlant