question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

versions 2.10.60 and above of sdk throw InternalServerError exception when using DynamoDB transactions

See original GitHub issue

Describe the bug

We have a very comprehensive set of System Tests that we have been running for the last 18 months. We recently upgraded the aws-sdk from version 2.10.56 to 2.13.25 and our our test suite began to fail with occasional calls to transactWriteItems. Our test suite calls transactWriteItems hundreds of times and only fails maybe once or twice. I reran the test suite numerous times with version bisection from 2.10.56 to 2.13.25 which failed with the same transactWriteItems failure each time untilI reached 2.10.59 which succeeded. Our test suite (which has been running for some time) now passes every time with 2.10.59 but fails with a transactWriteItems on every version since then.

Expected Behavior

I expect the same test suite to pass (reasonably consistently) with versions of the sdk since 2.10.59

Current Behavior

The tests fail with a least one InternaServerError from transactWriteItems on every run with any version since 2.10.60 - the same tests pass every time with 2.10.59

Example stack trace Internal server error (Service: DynamoDb, Status Code: 500, Request ID: KDGNGE98O67GG0VUO7E0GG88VRVV4KQNSO5AEMVJF66Q9ASUAAJG): software.amazon.awssdk.services.dynamodb.model.InternalServerErrorException software.amazon.awssdk.services.dynamodb.model.InternalServerErrorException: Internal server error (Service: DynamoDb, Status Code: 500, Request ID: KDGNGE98O67GG0VUO7E0GG88VRVV4KQNSO5AEMVJF66Q9ASUAAJG) at software.amazon.awssdk.core.internal.http.CombinedResponseHandler.handleErrorResponse(CombinedResponseHandler.java:125) at software.amazon.awssdk.core.internal.http.CombinedResponseHandler.handleResponse(CombinedResponseHandler.java:81) at software.amazon.awssdk.core.internal.http.CombinedResponseHandler.handle(CombinedResponseHandler.java:61) at software.amazon.awssdk.core.internal.http.CombinedResponseHandler.handle(CombinedResponseHandler.java:42) at software.amazon.awssdk.core.internal.http.pipeline.stages.HandleResponseStage.execute(HandleResponseStage.java:40) at software.amazon.awssdk.core.internal.http.pipeline.stages.HandleResponseStage.execute(HandleResponseStage.java:30) at software.amazon.awssdk.core.internal.http.pipeline.RequestPipelineBuilder$ComposingRequestPipelineStage.execute(RequestPipelineBuilder.java:206) at software.amazon.awssdk.core.internal.http.pipeline.stages.ApiCallAttemptTimeoutTrackingStage.execute(ApiCallAttemptTimeoutTrackingStage.java:74) at software.amazon.awssdk.core.internal.http.pipeline.stages.ApiCallAttemptTimeoutTrackingStage.execute(ApiCallAttemptTimeoutTrackingStage.java:43) at software.amazon.awssdk.core.internal.http.pipeline.stages.TimeoutExceptionHandlingStage.execute(TimeoutExceptionHandlingStage.java:78) at software.amazon.awssdk.core.internal.http.pipeline.stages.TimeoutExceptionHandlingStage.execute(TimeoutExceptionHandlingStage.java:40) at software.amazon.awssdk.core.internal.http.pipeline.stages.RetryableStage$RetryExecutor.doExecute(RetryableStage.java:114) at software.amazon.awssdk.core.internal.http.pipeline.stages.RetryableStage$RetryExecutor.execute(RetryableStage.java:87) at software.amazon.awssdk.core.internal.http.pipeline.stages.RetryableStage.execute(RetryableStage.java:63) at software.amazon.awssdk.core.internal.http.pipeline.stages.RetryableStage.execute(RetryableStage.java:43) at software.amazon.awssdk.core.internal.http.pipeline.RequestPipelineBuilder$ComposingRequestPipelineStage.execute(RequestPipelineBuilder.java:206) at software.amazon.awssdk.core.internal.http.StreamManagingStage.execute(StreamManagingStage.java:57) at software.amazon.awssdk.core.internal.http.StreamManagingStage.execute(StreamManagingStage.java:37) at software.amazon.awssdk.core.internal.http.pipeline.stages.ApiCallTimeoutTrackingStage.executeWithTimer(ApiCallTimeoutTrackingStage.java:81) at software.amazon.awssdk.core.internal.http.pipeline.stages.ApiCallTimeoutTrackingStage.execute(ApiCallTimeoutTrackingStage.java:61) at software.amazon.awssdk.core.internal.http.pipeline.stages.ApiCallTimeoutTrackingStage.execute(ApiCallTimeoutTrackingStage.java:43) at software.amazon.awssdk.core.internal.http.pipeline.RequestPipelineBuilder$ComposingRequestPipelineStage.execute(RequestPipelineBuilder.java:206) at software.amazon.awssdk.core.internal.http.pipeline.RequestPipelineBuilder$ComposingRequestPipelineStage.execute(RequestPipelineBuilder.java:206) at software.amazon.awssdk.core.internal.http.pipeline.stages.ExecutionFailureExceptionReportingStage.execute(ExecutionFailureExceptionReportingStage.java:37) at software.amazon.awssdk.core.internal.http.pipeline.stages.ExecutionFailureExceptionReportingStage.execute(ExecutionFailureExceptionReportingStage.java:26) at software.amazon.awssdk.core.internal.http.AmazonSyncHttpClient$RequestExecutionBuilderImpl.execute(AmazonSyncHttpClient.java:198) at software.amazon.awssdk.core.internal.handler.BaseSyncClientHandler.invoke(BaseSyncClientHandler.java:122) at software.amazon.awssdk.core.internal.handler.BaseSyncClientHandler.doExecute(BaseSyncClientHandler.java:148) at software.amazon.awssdk.core.internal.handler.BaseSyncClientHandler.execute(BaseSyncClientHandler.java:102) at software.amazon.awssdk.core.client.handler.SdkSyncClientHandler.execute(SdkSyncClientHandler.java:45) at software.amazon.awssdk.awscore.client.handler.AwsSyncClientHandler.execute(AwsSyncClientHandler.java:55) at software.amazon.awssdk.services.dynamodb.DefaultDynamoDbClient.transactWriteItems(DefaultDynamoDbClient.java:4079)

Possible Solution

We are using AWS Lambda to call DynamoDB. The DDB client is configured to use UrlConnectionHttpClient (which I see was changed in this commit between 2.10.59 and 2.10.60 - may be unrelated but thought I would let you know)

  • AWS Java SDK version used: fails with 2.10.60 and above
  • JDK version used: Java 8
  • Operating System and version: AWS Lambda

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:16 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
debora-itocommented, Aug 12, 2020

@sihutch So according to the DynamoDB service team there’s a known issue where if you delete and re-create tables with the same name some of the requests result in InternalServerError. They have a task to fix this in their backlog.

Marking this as closing soon. Let us know if you have any other question or concern.

0reactions
debora-itocommented, Oct 28, 2021

@stuartleylandcole thank you for the follow-up. Glad you’re not getting bit by this anymore.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error handling with DynamoDB - AWS Documentation
Discover the best practices for handling client and server errors and exceptions returned by Amazon DynamoDB operations.
Read more >
DynamoDbClient (AWS Java SDK :: Services :: Amazon DynamoDB ...
InternalServerErrorException - An error occurred on the server side. SdkException - Base class for all exceptions that can be thrown by the SDK...
Read more >
Common DynamoDB Errors (and Solutions) - Dynobase
This page is a compilation of the most common DynamoDB user/system errors and how ... Internal Server Error · AWS DynamoDB errors ResourceNotFoundException...
Read more >
amazon web services - Mysterious TransactionConflict in ...
DynamoDB transactions provide serializable isolation. ... the transaction is canceled and an exception is thrown with details about which ...
Read more >
InternalServerErrorException (AWS SDK for Java - 2.18.30)
declaration: package: software.amazon.awssdk.services.dynamodb.model, class: InternalServerErrorException.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found