Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Value default for parameter MessageGroupId is invalid #54

Open
bilalnaqvi opened this issue Mar 7, 2023 · 2 comments
Open

Value default for parameter MessageGroupId is invalid #54

bilalnaqvi opened this issue Mar 7, 2023 · 2 comments

Comments

@bilalnaqvi
Copy link

Flaskcelery code which is working with AWS SQS fifo Queue giving this error
botocore.exceptions.ClientError: An error occurred (InvalidParameterValue) when calling the SendMessage operation: Value default for parameter MessageGroupId is invalid. The request include parameter that is not valid for this queue type

i created the Queue using command line
aws --endpoint-url http://localhost:9324 sqs create-queue --queue-name queue_name.fifo --attributes '{"FifoQueue": "True", "ContentBasedDeduplication":"True"}'

Req body

{'url_path': '/', 'query_string': '', 'method': 'POST', 'headers': {'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8', 'User-Agent': 'Boto3/1.17.112 Python/3.8.9 Darwin/18.7.0 Botocore/1.20.112'}, 'body': {'Action': 'SendMessage', 'Version': '2012-11-05', 'QueueUrl': 'http://localhost:9324/queue/queue-send-email-task.fifo', 'MessageBody': 'eyJib2R5Ijo...4a1d353e7'}, 'url': 'http://localhost:9324/', 'context': {'client_region': 'eu-central-1', 'client_config': <botocore.config.Config object at 0x10a7d84f0>, 'has_streaming_input': False, 'auth_type': None}}

@VladPetriv
Copy link

Hey @bilalnaqvi !
Did you solve this issue?

@GDuparquet
Copy link

GDuparquet commented Nov 16, 2023

Flaskcelery code which is working with AWS SQS fifo Queue giving this error botocore.exceptions.ClientError: An error occurred (InvalidParameterValue) when calling the SendMessage operation: Value default for parameter MessageGroupId is invalid. The request include parameter that is not valid for this queue type

i created the Queue using command line aws --endpoint-url http://localhost:9324 sqs create-queue --queue-name queue_name.fifo --attributes '{"FifoQueue": "True", "ContentBasedDeduplication":"True"}'

Req body

{'url_path': '/', 'query_string': '', 'method': 'POST', 'headers': {'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8', 'User-Agent': 'Boto3/1.17.112 Python/3.8.9 Darwin/18.7.0 Botocore/1.20.112'}, 'body': {'Action': 'SendMessage', 'Version': '2012-11-05', 'QueueUrl': 'http://localhost:9324/queue/queue-send-email-task.fifo', 'MessageBody': 'eyJib2R5Ijo...4a1d353e7'}, 'url': 'http://localhost:9324/', 'context': {'client_region': 'eu-central-1', 'client_config': <botocore.config.Config object at 0x10a7d84f0>, 'has_streaming_input': False, 'auth_type': None}}

You run into this error because your queue is a FIFO type queue. You must provide MessageGroupID and MessageDeduplicationID attributes to successfully send your message.

https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-sqs/interfaces/sendmessagecommandinput.html#messagededuplicationid
https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-sqs/interfaces/sendmessagecommandinput.html#messagededuplicationid

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants