- Newest
- Most votes
- Most comments
The INTERNAL_ERROR_QUERY_ENGINE error you're experiencing is an internal Athena error that occurs on the query engine side. This type of error is not typically caused by user input but rather by an issue within Athena's system itself.
Based on your detailed description, you're facing multiple issues with the CloudWatch Athena connector:
-
RequestEntityTooLarge Error: This is occurring because your log group contains approximately 1 million log streams, causing the metadata response to exceed the 6MB Lambda payload limit. This is a known limitation when dealing with log groups that have an extremely large number of log streams.
-
FUNCTION_NOT_FOUND Error: With the older connector version, the system.query function wasn't properly registered, which explains why it wasn't showing up in your SHOW FUNCTIONS results.
-
INTERNAL_ERROR_QUERY_ENGINE Error: After updating to the latest connector version, you're now encountering this internal Athena error, which indicates an issue within Athena's query engine itself.
Here are some potential approaches to resolve these issues:
- For the RequestEntityTooLarge issue:
- Consider using time-based filtering to reduce the number of log streams being processed at once
- Use the passthrough query functionality (system.query) once it's working properly
- For the FUNCTION_NOT_FOUND and INTERNAL_ERROR_QUERY_ENGINE issues:
- Retry your query, as sometimes these internal errors are transient
- Simplify your query if possible to identify if a specific part is causing the issue
- Verify that all tables referenced in your query exist and have the expected structure
- Check Athena service status for any reported issues in your region
If these steps don't resolve the issue, you should contact AWS Support for further assistance. They have access to more detailed logs and can investigate the root cause of these internal errors. Since INTERNAL_ERROR_QUERY_ENGINE is an internal system error (not caused by your input), AWS Support would be best positioned to help resolve this.
Remember that you won't be charged for queries that result in the INTERNAL_ERROR_QUERY_ENGINE error.
Sources
INTERNAL_ERROR_QUERY_ENGINE | AWS re:Post
ErrorCode: INTERNAL_ERROR_QUERY_ENGINE | AWS re:Post
ATHENA INTERNAL_ERROR_QUERY_ENGINE | AWS re:Post
Athena error catalog - Amazon Athena
Relevant content
- asked 10 months ago
- asked 3 years ago
- asked 3 years ago

When calling
'system.query'here is what appears in the log of the in the connector's Lambda logs