How do I troubleshoot HTTP 400 errors in Amazon DynamoDB?

2 分的閱讀內容
0

I want to resolve HTTP 400 exceptions in Amazon DynamoDB.

Short description

You get an HTTP 400 status code error if there are problems with your request. You must fix the issue in your application before you submit the request again. For a complete list of errors, see HTTP status code 400.

To view client-side errors and determine the root cause, use the Amazon CloudWatch UserErrors metric.

Note: The UserErrors metric doesn't show HTTP 400 errors at the table or stream level. The metric is an aggregate of 400 errors for the current Region and the current AWS account.

Exceptions such as AccessDeniedException, IncompleteSignatureException, ResourceNotFoundException, and ValidationException, also result in user errors. However, the UserErrors metric doesn't capture ProvisionedThroughputExceededException or ConditionalCheckFailedException because these exceptions are measured separately in CloudWatch. For more information, see DynamoDB metrics.

Resolution

Use the following statistics for the UserErrors metric:

  • Sum: the total number of user errors within the specified time frame
  • SampleCount: the total number of requests that resulted in user errors within the specified time frame

To find the HTTP 400 error message, complete the following steps:

  1. Note the time frame that's specified in the UserErrors metric.
  2. Check the client's application logs for error and exception messages within the specified time frame.
  3. Based on the error code, see the related troubleshooting steps in HTTP status code 400.

To prevent user errors, add try-catch or if-then statements to catch and respond to exceptions. For more information, see Error handling with DynamoDB.

You might get 400 errors such as ResourceInUseException and LimitExceededException, if the table is not in the ACTIVE state. If you get 400 errors when your table is in a temporary state, then retry your requests after the table transitions to the ACTIVE state.

Related information

Common errors

Logging DynamoDB operations by using AWS CloudTrail

AWS 官方
AWS 官方已更新 6 個月前