How do I resolve HTTP 5xx errors in DynamoDB?
Last updated: 2020-07-01
When I work with items in an Amazon DynamoDB table, I get a HTTP 5xx error like this: "Internal server error (Service: AmazonDynamoDBv2; Status Code: 500; Error Code: InternalServerError".
A 5xx error indicates a problem that must be resolved by AWS. This might be a transient issue, such as a network outage or backend hardware failure. To mitigate 5xx errors:
- Implement a retry strategy for requests that fail with a 5xx error code. All AWS SDKs have a built-in retry mechanism with an algorithm that uses exponential backoff. You can modify the retry parameters to suit your needs. For more information, see Error retries and exponential backoff.
- Avoid strongly consistent reads. When there's a network delay or outage, strongly consistent reads are more likely to fail with a 500 error. For more information, see Read consistency.
If you keep getting 5xx errors, go to the AWS Service Health dashboard to see if there are any operational issues with the service.