-
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
Undefined method `each_pair' for nil:NilClass - DynamoDB #140
Comments
I'm using it roughly like so:
|
Can you provide a backtrace for the above exception? |
Sure, not much to the back trace though. Thanks for the quick reply!
|
I thought perhaps #161 might fix this, however its close but no cigar. Still having
at https://github.com/aws/aws-sdk-ruby/blob/master/lib/aws/dynamo_db/batch_get.rb#L150 sporadically. |
I wonder if this is all related. I randomly get this error quite a bit when using DynoDB with threads. undefined method |
Looking at that stack trace it doesn't appear to be related. However don't hold me to it 😉 |
@jmclachlan Are you calling |
Nope. You are right. I think this is just a more general issue with the base client initialization and threads. My bad. |
@trevorrowe Awesome. That fixes everything. Thanks a bunch. |
@trevorrowe Is there anything more I can do to help figure out why these nil's keep cropping in |
I can not verify this yet (I will though), but it looks like DynamoDB is not returning the data at 'Responses'. My guess is the response is returned with no data, and ALL of the request items are returned as unprocessed keys. If this is the case, the fix is a one-liner ( |
I should also add, this could be happening if you are getting throttled. |
There's a good chance that we're getting throttled every now and again so that could be the cause. |
I'll also add I've just seen this happen on |
@karlfreeman Sorry for the long absence on this issue. In both cases, it would be possible to coerce the nil value to an empty array. I'm afraid by doing this, we could mask some other issue. If you are able to reproduce this issue somewhat reliably it would be SUPER helpful if you could enable http wire logging. This would dump the entire http response body (that is getting JSON parsed) and would answer the question if the key is missing from the source, or if there is some issue in the SDK causing this buggy behavior. You can enable http wire logging like so: # send the log output somewhere more useful than stdout, like a file
require 'logger'
AWS.config(:http_wire_trace => true, :logger => Logger.new($stdout)) You can reduce the scope of what requests get wire-logged by creating a ddb instance that logs instead: ddb_without_wire_trace = AWS::DynamoDB.new
ddb_with_wire_trace = AWS::DynamoDB.new(:http_wire_trace => true, :logger => Logger.new(...)) Thanks! |
I'm going to close this issue since there has been no feedback in the last few months. @karlfreeman, if you are still having problems with DynamoDB in your application, please follow @trevorrowe's instructions and provide some more detailed logging of your requests so we can narrow down the problem. Thanks! |
I keep seeing this sporadically happening when using batch_get. It looks like it stems from when each_attributes calls each which sometimes returns nil. Is this the desired affect?
The text was updated successfully, but these errors were encountered: