SimpleDB gem issues with aws-sdk-core >= 3.192.0
Closed this issue · 4 comments
Describe the bug
Aws::SimpleDB::Client#put_attributes fails with No attributes
error
Aws::SimpleDB::Client#batch_put_attributes fails with No items specified
error
Expected Behavior
Should not raise an error on a valid API call.
Current Behavior
Raises errors with the methods listed above and probably some others too.
Reproduction Steps
The following code fails with No attributes
:
client = Aws::SimpleDB::Client.new
client.create_domain(domain_name: 'test domain')
client.put_attributes(domain_name: 'test_domain', item_name: 'test_item', attributes: [{ name: 'attr1', value: 'value1', replace: true }])
Possible Solution
There seems to be an issue with the parameter serialization in that some parameter names are pluralized where they shouldn't be. Here's a failing batch_put_attributes call wire trace:
<- "POST / HTTP/1.1\r\nAccept-Encoding: \r\nContent-Type: application/x-www-form-urlencoded; charset=utf-8\r\nUser-Agent: aws-sdk-ruby3/3.192.1 ua/2.0 os/macos#23 md/arm64 lang/ruby#3.2.3 md/3.2.3 cfg/retry-mode#legacy\r\nContent-Length: 567\r\nAccept: */*\r\nHost: sdb.amazonaws.com\r\n\r\n"
<- "AWSAccessKeyId=REDACTED&Action=BatchPutAttributes&DomainName=test_domain&Items.1.Attributes.1.Name=attr1&Items.1.Attributes.1.Replace=true&Items.1.Attributes.1.Value=value1&Items.1.Attributes.2.Name=attr2&Items.1.Attributes.2.Replace=true&Items.1.Attributes.2.Value=value2&Items.1.Attributes.3.Name=attr3&Items.1.Attributes.3.Replace=true&Items.1.Attributes.3.Value=value3&Items.1.ItemName=item1&Signature=REDACTED&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2024-04-25T07%3A22%3A59Z&Version=2009-04-15"
-> "HTTP/1.1 400 Bad Request\r\n"
-> "Date: Thu, 25 Apr 2024 07:22:59 GMT\r\n"
-> "Transfer-Encoding: chunked\r\n"
-> "Connection: close\r\n"
-> "Server: Amazon SimpleDB\r\n"
-> "\r\n"
-> "e9\r\n"
reading 233 bytes...
-> "<?xml version=\"1.0\"?>\n<Response><Errors><Error><Code>MissingParameter</Code><Message>No items specified</Message><BoxUsage>0.0000000000</BoxUsage></Error></Errors><RequestID>07e489af-a509-701a-5868-98f99b88ac83</RequestID></Response>"
read 233 bytes
reading 2 bytes...
-> "\r\n"
read 2 bytes
-> "0\r\n"
-> "\r\n
Additional Information/Context
No response
Gem name ('aws-sdk', 'aws-sdk-resources' or service gems like 'aws-sdk-s3') and its version
aws-sdk-core:3.192.1
Environment details (Version of Ruby, OS environment)
ruby 3.3, MacOS/Linux
Thanks for opening an issue. In this version of core, we made many fixes to all of the protocol building and parsing logic, and aligned them to proper specification.
Simple DB is extremely deprecated and we do not publish any new versions of that gem. Additionally, it would not make sense to revert any fixes we made to core.
My recommendation would be to pin your core version to the last working version. I would also recommend moving to Dynamo DB!
This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.
Thanks, but I switched to using DynamoDB as per your recommendation.