Troubleshoot Amazon Athena data source issues
This document provides solutions to common issues you may encounter when configuring or using the Amazon Athena data source. For configuration instructions, refer to Configure the Amazon Athena data source.
Authentication errors
These errors occur when AWS credentials are invalid, missing, or don’t have the required permissions.
“Access denied” or “Authorization failed”
Symptoms:
- Save & test fails with authorization errors.
- Queries return access denied messages.
- Resource drop-downs (catalogs, databases, tables) don’t load.
Possible causes and solutions:
Access denied with AWS Lake Formation
Symptoms:
- Save & test succeeds but queries return access denied errors.
- Queries fail despite having valid Athena, Glue, and S3 permissions.
- Errors occur only for tables managed by AWS Lake Formation.
Solutions:
- Add the
lakeformation:GetDataAccesspermission to the IAM policy used by the data source. Refer to the IAM policies section for the full policy example. - Verify the IAM identity is registered as a data lake administrator or has been granted table-level permissions in Lake Formation. Refer to the AWS Lake Formation permissions for Athena documentation.
Invalid token errors in private clouds
Symptoms:
- Authentication fails with invalid token errors.
- Occurs when using AWS GovCloud or other private cloud partitions.
Solutions:
- Ensure you’re using the correct endpoint for your private cloud partition.
- Set a custom Endpoint in the data source configuration that matches your private cloud.
- Verify the region is set to the correct GovCloud or private partition region.
Connection errors
These errors occur when Grafana can’t reach the Amazon Athena service endpoints.
“Failed to create HTTP client” or connection timeout
Symptoms:
- Save & test fails with connection errors.
- Queries time out.
- Drop-downs fail to load.
Solutions:
- Verify network connectivity from the Grafana server to AWS endpoints.
- Check that firewall rules allow outbound HTTPS (port 443) to AWS service endpoints.
- If you’re using a custom Endpoint, verify the URL is correct and reachable.
- For Grafana Cloud accessing private resources, configure Private data source connect.
Query errors
These errors occur when executing queries against Amazon Athena.
“No data” or empty results
Symptoms:
- The query executes without error but returns no data.
- Charts display a “No data” message.
Possible causes and solutions:
Query timeout
Symptoms:
- The query runs for a long time then fails.
- Error mentions timeout or query limits.
Solutions:
- Narrow the dashboard time range to reduce the volume of data scanned.
- Add filters to your query to reduce the result set.
- Use partitioned tables to limit the amount of data Athena scans.
- Break complex queries into smaller parts.
- Verify that async query data support is enabled (it is by default), which prevents long-running queries from timing out.
Macro errors
Symptoms:
- Query fails with errors referencing macros like
$__timeFilter,$__timeGroup, or$__dateFilter. - Error messages such as “macro $__timeGroup needs time column and interval” or “expected at least one argument”.
Possible causes and solutions:
“Unknown column type”
Symptoms:
- Query fails with an error referencing an unsupported column type.
Solutions:
- Check the column types in your Athena table and ensure they’re supported.
- Use a
CASTexpression to convert the column to a supported type, such asCAST(my_column AS VARCHAR).
Query doesn’t work when pasted into Amazon Athena
Symptoms:
- A query works in Grafana but fails when copied directly into the Amazon Athena console.
Solutions:
- Grafana macros (like
$__timeFilter) aren’t valid Athena SQL. Use the Query Inspector to view the fully interpolated query. Click the Query Inspector button and select the Query tab to copy the expanded SQL.
Template variable errors
These errors occur when using template variables with the Amazon Athena data source.
Variables return no values
Solutions:
- Verify the data source connection is working by running Save & test in the data source settings.
- Check that parent variables (for cascading variables) have valid selections.
- Verify the IAM identity has permissions to query the tables referenced in the variable query.
- Ensure the variable query returns results. Test the query directly in the query editor first.
Variables are slow to load
Solutions:
- Set variable refresh to On dashboard load instead of On time range change to reduce how often variables re-query.
- Simplify variable queries, for example, by using
SELECT DISTINCT column FROM table LIMIT 100to cap results.
Query result reuse errors
These errors relate to the query result reuse feature.
Result reuse isn’t working
Symptoms:
- Queries execute fresh each time despite enabling result reuse.
Possible causes and solutions:
Performance issues
These issues relate to slow queries or API limits.
API throttling
Symptoms:
- Intermittent errors across multiple panels.
- Dashboard panels occasionally fail to load.
Solutions:
- Reduce the frequency of dashboard auto-refresh.
- Reduce the number of panels querying Athena on a single dashboard.
- Enable query caching to reduce the number of API calls (available in Grafana Enterprise and Grafana Cloud).
- Request a service quota increase from AWS if you consistently hit API rate limits.
Enable debug logging
To capture detailed error information for troubleshooting:
Set the Grafana log level to
debugin the configuration file:[log] level = debugReview logs in
/var/log/grafana/grafana.log(or your configured log location).Look for entries related to
grafana-athena-datasourcethat include request and response details.Reset the log level to
infoafter troubleshooting to avoid excessive log volume.
Get additional help
If you’ve tried the solutions in this document and still encounter issues:
- Check the Grafana community forums for similar issues.
- Review the Athena data source plugin GitHub issues for known bugs.
- Refer to the Amazon Athena documentation for service-specific guidance.
- Contact Grafana Support if you’re a Grafana Cloud Pro, Cloud Advanced, or Grafana Enterprise customer.
- When reporting issues, include:
- Grafana version and plugin version.
- Error messages (redact sensitive information).
- Steps to reproduce the issue.
- Relevant configuration (redact credentials).


