Troubleshoot Google BigQuery data source issues
This document provides solutions to common issues you may encounter when configuring or using the Google BigQuery data source. For configuration instructions, refer to Configure the BigQuery data source.
Authentication errors
These errors occur when credentials are invalid, missing, or don’t have the required permissions.
“Access denied” or “Permission denied”
Symptoms:
- Save & test fails with access denied errors
- Queries return permission denied messages
- Projects, datasets, or tables don’t load in drop-downs
Possible causes and solutions:
“Invalid JWT signature” or “Invalid token”
Symptoms:
- Data source test fails immediately
- Error mentions JWT or token validation
Solutions:
- Verify the service account key file is valid JSON.
- Check that the private key in the configuration matches the key file.
- Ensure the
tokenUriis set tohttps://oauth2.googleapis.com/token. - Create a new service account key if the current one is corrupted.
“Service account impersonation failed”
Symptoms:
- Queries fail when using service account impersonation
- Error mentions impersonation or token creation
Solutions:
- Verify the source service account has the Service Account Token Creator role (
roles/iam.serviceAccountTokenCreator). - Ensure the target service account (being impersonated) has the required BigQuery roles.
- Check that the target service account email is correctly configured.
Forward OAuth Identity not working
Symptoms:
- Queries fail when using Forward OAuth Identity
- User sees authentication errors after logging in
Solutions:
- Verify the OAuth scopes are configured in Grafana’s OAuth settings:
https://www.googleapis.com/auth/bigqueryandhttps://www.googleapis.com/auth/drive(if querying data linked to Google Drive). - Ensure users have authenticated with Google OAuth before accessing BigQuery dashboards.
- Check that the Default project is configured in the data source settings.
Note
Forward OAuth Identity doesn’t support alerting or other background features that require credentials when users aren’t logged in.
Connection errors
These errors occur when Grafana cannot reach Google BigQuery endpoints.
“Connection refused” or timeout errors
Symptoms:
- Data source test times out
- Queries fail with network errors
- Intermittent connection failures
Solutions:
- Verify network connectivity from the Grafana server to Google Cloud endpoints.
- Check firewall rules allow outbound HTTPS (port 443) to
*.googleapis.com. - If using a proxy, ensure it’s configured correctly in Grafana’s settings.
- For Grafana Cloud accessing private resources, configure Private data source connect.
“Could not resolve host”
Symptoms:
- DNS resolution errors in logs
- Unable to reach Google API endpoints
Solutions:
- Verify DNS settings on the Grafana server.
- Test DNS resolution:
nslookup bigquery.googleapis.com. - Check for network policy restrictions blocking external DNS.
Query errors
These errors occur when executing queries against BigQuery.
“No data” or empty results
Symptoms:
- Query executes without error but returns no data
- Charts show “No data” message
- Tables are empty
Possible causes and solutions:
“Syntax error” or “Query parse error”
Symptoms:
- Query fails with syntax error
- Error points to a specific position in the query
Solutions:
- Use the query validator in the SQL editor to identify syntax issues.
- Verify table and column names are correctly quoted with backticks.
- Check that macros are used correctly (for example,
$__timeFilter(column)not$__timeFilter). - Ensure BigQuery Standard SQL syntax is used, not Legacy SQL.
Query timeout
Symptoms:
- Query runs for a long time then fails
- Error mentions timeout or exceeded limits
Solutions:
- Narrow the time range to reduce data volume.
- Add filters to reduce the result set.
- Use partitioned tables and filter on the partition column.
- Add
LIMITclause for exploratory queries. - Consider pre-aggregating data for frequently-used queries.
“Query exceeded resource limits”
Symptoms:
- Error mentions resource limits or quota exceeded
- Query fails after processing some data
Solutions:
- Simplify the query by reducing JOINs or subqueries.
- Break complex queries into smaller parts.
- Use approximate aggregation functions where precision isn’t critical.
- Request a quota increase in Google Cloud Console if needed.
Incorrect data types
Symptoms:
- Numbers appear as strings
- Timestamps aren’t recognized
- Visualization doesn’t work as expected
Solutions:
- Use explicit type casting in your query:
CAST(column AS INT64). - Alias timestamp columns as
time:SELECT timestamp_col AS time. - Verify the column types in BigQuery match what Grafana expects.
Template variable errors
These errors occur when using template variables with the data source.
Variables return no values
Symptoms:
- Variable drop-down is empty
- “No options found” message appears
Solutions:
- Test the data source connection using Save & test.
- Run the variable query manually in the query editor to verify it returns results.
- Check that the service account has permission to query the tables referenced in the variable query.
- For chained variables, ensure parent variables have valid selections.
Variables are slow to load
Symptoms:
- Dashboard takes a long time to load
- Variable drop-downs are unresponsive
Solutions:
- Set variable refresh to On dashboard load instead of On time range change.
- Add
LIMITto variable queries to reduce result count. - Simplify variable queries to scan less data.
- Use caching if available in your Grafana edition.
Variable value not interpolated
Symptoms:
- Query shows
$variableliterally instead of the value - Error about unknown identifier
Solutions:
- Verify the variable name matches exactly (case-sensitive).
- Use
${variable}syntax when the variable is adjacent to other text. - Check the Query Inspector to see how variables are interpolated.
Performance issues
These issues relate to slow queries or high costs.
Queries are slow
Symptoms:
- Dashboards take a long time to load
- Queries timeout frequently
Solutions:
- Use partitioned tables and filter on partition columns with
$__timeFilter. - Select only the columns you need instead of
SELECT *. - Use appropriate aggregation intervals to reduce data points.
- Consider using BigQuery BI Engine for frequently accessed data.
High query costs
Symptoms:
- Unexpected BigQuery charges
- Quota warnings from Google Cloud
Solutions:
- Review query costs in BigQuery Console under Query history.
- Use
$__timeFilterto limit data scanned to the dashboard time range. - Avoid
SELECT *and select only required columns. - Set appropriate dashboard refresh intervals (don’t refresh more often than needed).
- Consider enabling query caching in Grafana Enterprise or Grafana Cloud.
Storage API errors
Symptoms:
- Errors when using the Storage API option
- “Storage API not enabled” message
Solutions:
- Enable the BigQuery Storage API in your project.
- Ensure the service account has the BigQuery Read Session User role.
- Disable Storage API if not needed for your use case.
Note
The Storage API doesn’t work with Forward OAuth Identity authentication.
Configuration errors
These errors occur during data source setup or provisioning.
“Failed to save datasource”
Symptoms:
- Unable to save data source configuration
- Error when clicking Save & test
Solutions:
- Verify all required fields are filled in.
- Check that the JSON key file is valid and complete.
- Ensure Grafana has write permissions to its data directory.
Provisioning errors
Symptoms:
- Provisioned data source doesn’t appear
- Errors in Grafana logs about provisioning
Solutions:
- Verify YAML syntax is correct (use a YAML validator).
- Check that
typeis set tografana-bigquery-datasource. - Ensure
authenticationTypematches the credentials provided. - For
privateKeyinsecureJsonData, ensure newlines are preserved (use|for multiline strings in YAML).
Example with multiline private key:
apiVersion: 1
datasources:
- name: BigQuery
type: grafana-bigquery-datasource
jsonData:
authenticationType: jwt
clientEmail: <SERVICE_ACCOUNT_EMAIL>
defaultProject: <PROJECT_ID>
tokenUri: https://oauth2.googleapis.com/token
secureJsonData:
privateKey: |
-----BEGIN PRIVATE KEY-----
<KEY_CONTENT>
-----END PRIVATE KEY-----Enable debug logging
To capture detailed error information for troubleshooting:
Set the Grafana log level to
debugin the configuration file:[log] level = debugRestart Grafana.
Review logs in
/var/log/grafana/grafana.log(or your configured log location).Look for
bigqueryorgrafana-bigquery-datasourceentries.Reset the log level to
infoafter troubleshooting to avoid excessive log volume.
Use Query Inspector
The Query Inspector helps debug query issues:
- Open a panel in edit mode.
- Click the Query Inspector button.
- Review the Query tab to see the exact SQL sent to BigQuery.
- Check the Stats tab for query timing information.
- Look at the JSON tab for the raw response data.
Get additional help
If you’ve tried the solutions above and still encounter issues:
- Check the Grafana community forums for similar issues.
- Review the BigQuery plugin GitHub issues for known bugs.
- Consult the Google BigQuery documentation for BigQuery-specific guidance.
- Contact Grafana Support if you’re a Grafana Cloud or Enterprise customer.
When reporting issues, include:
- Grafana version
- BigQuery plugin version
- Error messages (redact sensitive information)
- Steps to reproduce
- Relevant configuration (redact credentials)
- Query Inspector output if applicable



