-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
DynamoDB #query method returns response with items = nil #2914
Comments
That member should always be present. Can you try to reproduce and get a wire trace with |
Thank you! We will try to get the logs. |
Hi, I believe I managed to reproduce and find the wire trace logs for this:
From what I understand, it should log I did notice the |
Wow! Thanks. We will forward this request Id to the DynamoDB team and have them investigate. This is either an undocumented behavior or just a bug (probably the latter). |
FWIW content length is correct assuming the body is |
Thanks! |
Hi @rhuang, while we wait for the service team to respond, could you please let me know if you use any proxy that may be in the middle of the request? Thanks! |
No, there is no proxy. |
@rhuang Can you share any surrounding code? DynamoDb is still investigating, and somehow this is being treated as a PutItem request (hence empty response), but the Ruby SDK looks to correctly set the target header to be a query operation. |
@andrykonchin Might be better suited to answer since I'm using his I had pasted the backtrace here as well: Dynamoid/dynamoid#516 (comment) On my end, My app makes this call all the time, and it only sometimes throws the |
DynamoDB team is asking for us to reproduce again, not just with that wire trace option, but also if we can output the body of the request. Ruby's Net::HTTP http debug option doesn't do this by default unfortunately. Can you add this plugin to your DynamoDB client (once before initialization) and try to reproduce? It prints out the body and then rewinds, and continues calling SDK code.
|
Is your application multi threaded or have multiple connections or use multiple dynamodb clients in any way? |
I found 2 requests. I might have gotten the "HTTP REQUEST BODY" logs mixed up between the 2 requests. They are very close in time proximity so I can't tell which is which. Let me know if you need more information.
|
The second snippet looks to be a PutItem with Do you have the request headers for the first snippet? |
In both cases, the body is intended for query. Dynamoid may not be forwarding arguments to the correct client calls in some cases. |
DynamoDB team pulled the request ids and found that they are both put item requests getting query request body (query params). Common sense would say that if this were an issue with the SDK, more than one customer would be affected.. I am thinking this is an issue in dynamoid or usage of it. |
Thank you! I will close the issue for now. |
|
Describe the bug
Initial issue (Dynamoid/dynamoid#516) was reported in Dynamoid project. It seems the
#query
(link) method may return sometimes response with#items
equalnil
.Expected Behavior
I would expect
QueryOutput#items
to return Array of items or at least an empty Array if there are no items to fetch as the documentation states.https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/DynamoDB/Client.html#query-instance_method
Current Behavior
QueryOutput#items
returnsnil
Reproduction Steps
There is no way to constantly reproduce the issue. The issue is being reproduced occasionally.
Possible Solution
No response
Additional Information/Context
A GSI is used in the query
Gem name ('aws-sdk', 'aws-sdk-resources' or service gems like 'aws-sdk-s3') and its version
aws-sdk-dynamodb 1.80.0
Environment details (Version of Ruby, OS environment)
Ruby 3.0
The text was updated successfully, but these errors were encountered: