How do I resolve 4xx, 5xx, permission, and quota errors in Athena?

3 minute read
0

My Amazon Athena query returned 4xx, 5xx, permission, or quota errors and I want to resolve the issue.

Resolution

Follow these troubleshooting steps for the error message that you received.

Amazon S3 error codes

404 NoSuchKey error code

"Status Code: 404; Error Code: NoSuchKey : Error when file gets deleted during running query"

This error might occur if the requested object isn't available in the Amazon Simple Storage Service (Amazon S3) bucket. To resolve this issue, see How can I troubleshoot the 404 "NoSuchKey" error from Amazon S3?

503 SlowDown error code

"com.amazonaws.services.s3.model.AmazonS3Exception: Please reduce your request rate. (Service: Amazon S3; Status Code: 503; Error Code: SlowDown;"

This error might occur when you query an S3 bucket prefix with a large number of objects and exceed the per-second per-prefix quota. To resolve this issue, see How do I resolve the "HIVE_CANNOT_OPEN_SPLIT" Athena query error?

For more information on 5xx errors, see How do I troubleshoot a HTTP 500 or 503 error from Amazon S3?

AWS Glue Catalog permission errors

"Insufficient permissions to execute the query. User: arn:aws:iam:: 1111222233334444:user/athena_user is not authorized to perform: glue:GetTable on resource: arn:aws:glue:us-east-1:1111222233334444:database/doc_example_database with an explicit deny Query Id: example_query_ID"

This error might occur if the AWS Identity and Access Management (IAM) identity that runs the query doesn't have the required permissions. Make sure that the IAM user or role has the required permissions to access the AWS Glue resources.

To resolve this issue, see Why do I get the "Access Denied" error when I run a query in Amazon Athena?

Lake Formation permission errors

"Insufficient Lake Formation permission(s) on default (Service: AmazonDataCatalog; Status Code: 400; Error Code: AccessDeniedException; Request ID: c0057445-f644-4111-a793-1d2cd8bc9ac7; Proxy: null)"

This error occurs when the following conditions are true:

  • The IAM user or role tries to create or modify a Data Catalog resource in an Amazon S3 bucket that's registered with Amazon Lake Formation.
  • The IAM user or role doesn't have the appropriate data location permissions from Lake Formation.

To resolve this issue, you must grant appropriate data location permissions to the IAM user or role that you use to create the database or table.

Service quota errors

"ClientError: An error occurred (ThrottlingException) when calling the API_name operation: Rate exceeded."

This error occurs when you exceed the default quota for burst capacity or number of calls per second for Athena API calls.

Note: You can use capacity reservations to control Athena query concurrency capacity. For more information, see Managing query processing capacity.

"queryString failed to satisfy constraint: Member must have length less than or equal to 262144"

This error occurs because the maximum query string length in Athena is 262,144 bytes, and you exceed the maximum length. You can't adjust the maximum query string length quota. To resolve this error, split long queries into smaller ones. For more information, see How can I increase the maximum query string length in Amazon Athena?

"Athena Error No: 132, HTTP Response Code: 400, Exception Name: TooManyRequestsException, Error Message: You have exceeded the limit for the number of queries you can run concurrently. Please reduce the number of concurrent queries submitted by this account."

This error occurs If the sum of running and queued queries exceeds your DML or DDL query quota. To resolve this error, see How do I resolve the TooManyRequestsException error in Amazon Athena?

Related information

Common Errors

Troubleshooting in Athena

AWS OFFICIAL
AWS OFFICIALUpdated 3 months ago