InvalidParameterValue
aws
protocol_error
ai_generated
true
调用SendMessage操作时发生错误(InvalidParameterValue):一个或多个参数值无效。消息属性大小必须小于25600字节
An error occurred (InvalidParameterValue) when calling the SendMessage operation: One or more parameter values are invalid. Message attributes size must be smaller than 25600 bytes
ID: aws/sqs-message-attributes-too-large
92%修复率
86%置信度
1证据数
2023-08-12首次发现
版本兼容性
| 版本 | 状态 | 引入 | 弃用 | 备注 |
|---|---|---|---|---|
| sqs-2024 | active | — | — | — |
| aws-sdk-python-1.34.0 | active | — | — | — |
根因分析
消息属性的总大小(包括键和值)超过了SQS消息的25 KB限制。
English
The total size of message attributes (including keys and values) exceeds the 25 KB limit for SQS messages.
官方文档
https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-quotas.html解决方案
-
Move large attributes (e.g., binary data, large strings) to the message body instead. The body has a 256 KB limit. Example: sqs_client.send_message(QueueUrl=queue_url, MessageBody=json.dumps({'data': large_data}), MessageAttributes={'attr1': {'DataType': 'String', 'StringValue': 'small_value'}}) -
If attributes are necessary, store large attribute values in S3 or DynamoDB and pass only a reference (e.g., S3 key) as the attribute value.
无效尝试
常见但无效的做法:
-
90% 失败
SQS检查的是未压缩的属性大小,压缩不会改变原始大小。
-
100% 失败
FIFO队列与标准队列具有相同的属性大小限制。