How do I resolve HTTP 5xx errors in Amazon Keyspaces?

3 minute read
0

I want to troubleshoot HTTP 5xx errors in Amazon Keyspaces (for Apache Cassandra)

Resolution

You get a 5xx error when you perform table operations in Amazon Keyspaces when there are transient issues such as network outages or backend hardware failures.

If you get the Service Unavailable error, then check the AWS Health dashboard. Make sure that there are no events that affect your AWS account for that specific AWS Region. You can also contact AWS Support for Amazon Keyspaces to confirm that the service is healthy and reachable.

To troubleshoot Amazon Keyspaces API failure that's caused by a system error, view AWS CloudTrail logs. Retry the control plane operation.

When you migrate your data or there's a large number of write activities, you might get an InternalServerError exception. Amazon Keyspaces adapts the underlying storage partitions of your table automatically. The number of partitions scales up in response to changes in your application traffic or provisioned capacity. Partition splits can happen from a change in the overall load on your table traffic or load on an individual partition. When the partition splits, if the read or write operations try to hit that particular partition, then you might get a system error. To troubleshoot this error, construct the System Errors metric for your table. Use Sum for Statistic and 1 minute for period. For more information, see Amazon Keyspaces metrics and dimensions.

To troubleshoot read and write related system errors, turn on an application or client side logging mechanism. Implement a retry strategy for requests that fail with a 5xx error code with an algorithm that uses exponential backoff.

  • If you use an Apache Cassandra driver for your Java application, then add advanced.retry-policy to your driver configuration to turn on retries. You can add this retry policy to the application.conf file.

  • If your application runs on Python, then you can incorporate KeyspacesRetryPolicy into your solution to retry each server side error. For more information, see amazon-keyspaces-examples in the AWS Samples repository on GitHub.

Internal server errors are usually transient and mitigated by the Amazon Keyspaces service after some time. However, if you experience more InternalServerError exceptions than the number of successful requests, then contact AWS Support with the following information:

  • Keyspace name
  • Table name
  • Region
  • Issue start time
  • Information on if the issue periodic or intermittent
  • Client driver and application logs
AWS OFFICIAL
AWS OFFICIALUpdated 7 months ago