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.
Version and upgrade guidance
An outdated or out-of-sync plugin version is the most common cause of BigQuery data source failures. Before deeper troubleshooting, confirm you’re on the latest version. Upgrading and then restarting Grafana resolves a wide range of problems.
Note
On Grafana Cloud, the Google BigQuery plugin is managed by Grafana and updates automatically. On self-managed Grafana, you must update the plugin manually. In other managed environments, such as Azure Managed Grafana, the plugin version is controlled by the platform provider and can lag behind the latest release.
Symptoms of an outdated plugin version
These symptoms often appear after a Grafana or platform upgrade:
- Save & test fails with “An error occurred within the plugin” or another generic plugin error.
- The data source won’t save, or dashboards that previously loaded stop loading.
- The configuration tab looks blank or incomplete.
- Intermittent
Plugin unavailableor HTTP 500 errors, especially after a Pod or instance restart.
Check and update the plugin version
Navigate to Administration > Plugins and data > Plugins.
Search for Google BigQuery and open its page.
Review the installed version and the latest available version.
If an update is available and you’re on self-managed Grafana, click Update. You can also install or upgrade from the command line:
grafana cli plugins install grafana-bigquery-datasourceRestart Grafana after updating. The new version often doesn’t take effect until the instance restarts and finishes syncing the plugin.
Plugin version 3.x requires Grafana 11.6.11 or later. On Grafana 12.x, the plugin also requires these minimum patch versions: 12.0.10, 12.1.7, or 12.2.5, depending on your minor release. For older Grafana versions, use plugin version 2.x (requires Grafana 10.4.8 or later) or 1.x.
“An error occurred within the plugin” or generic plugin errors
Symptoms:
- Save & test fails with “An error occurred within the plugin”
- Generic “plugin error” messages without specific details
- Dashboards stop loading after a Grafana upgrade
Solutions:
- Update the BigQuery plugin to the latest version using the steps in Check and update the plugin version.
- Restart Grafana. An update that looks successful in the UI can still run the previous version until the instance restarts.
- Verify the plugin version is compatible with your Grafana version.
- If the error continues after update and restart, follow Plugin not registered or plugin not found.
“Plugin not registered” or “plugin not found”
Symptoms:
- Error message indicates the plugin is not registered, not found, or failed to load
- Dashboards show Datasource Error after a Grafana or platform change
- The plugin page shows the plugin as uninstalled or in an error state
- Occurs after Pod or instance restarts, including in Grafana Cloud
- Data source was previously working but becomes unavailable
Solutions:
- Open Administration > Plugins and data > Plugins, search for Google BigQuery, and check its status. If it isn’t installed or shows an error, install or reinstall it (uninstall, then install again).
- Restart Grafana after reinstalling. After a platform update or Pod restart, the plugin sometimes doesn’t re-register until you reinstall and restart.
- On self-managed Grafana, review the Grafana server logs for
grafana-bigquery-datasourceorgpx_bigqueryerrors. Refer to Enable debug logging. - On Grafana Cloud, you can’t access backend plugin logs directly. If a reinstall doesn’t restore the data source, contact Grafana Support and ask them to review the plugin logs.
- If the issue persists after reinstalling, contact Grafana Support.
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:
To isolate whether the failure is in Grafana or GCP, run the same query as the service account outside Grafana. In the Google Cloud Console query editor, or with the bq CLI after activating the key:
gcloud auth activate-service-account --key-file=<KEY_FILE>
bq query --use_legacy_sql=false --project_id=<PROJECT_ID> 'SELECT 1'If that query fails, fix IAM or APIs in GCP before changing the data source. If it succeeds and Grafana still returns 403, the data source is using different credentials or a different project than the ones you tested.
403 errors on queries when Save & test passes
Symptoms:
- Save & test succeeds but queries return 403 permission denied errors
- Only some queries fail while others work
Solutions:
- The service account has project-level access but is missing dataset or table-level permissions. In the BigQuery Console, verify the service account has read access to the specific datasets being queried.
- If you use one service account across several GCP projects, grant BigQuery Data Viewer and BigQuery Job User on every project the queries touch, not only the default project.
- Ensure the BigQuery API is enabled in each target project, not just the default project.
- Confirm the same query succeeds outside Grafana using the
bqCLI or Cloud Console steps in “Access denied” or “Permission denied”.
Project drop-down not populating
Symptoms:
- The GCP project drop-down in the query editor is empty
- No projects are listed when configuring the data source
- Other query features work correctly
Solutions:
- Grant the service account the
resourcemanager.projects.getpermission. This permission is included in the Browser role (roles/browser) or can be assigned through a custom role. - Ensure the Cloud Resource Manager API is enabled in the project.
- Verify the service account has access to the projects you expect to see listed. The drop-down only shows projects where the service account has at least one role.
Dataset drop-down not populating
Symptoms:
- The project drop-down has values, but the dataset drop-down is empty or missing datasets
- You can run SQL that names the dataset, but you can’t select it in Builder mode
The query editor lists datasets with BigQuery datasets.list, which returns only datasets the caller can get (bigquery.datasets.get). BigQuery Data Viewer and BigQuery Job User at project level include that. Dataset-scoped grants don’t, unless the identity is also a dataset READER.
Solutions:
- Prefer project-level BigQuery Data Viewer on the project that owns the datasets.
- If you must use dataset-level IAM, add the service account as a dataset READER (or grant
bigquery.datasets.get) on each dataset that should appear in the drop-down. - Confirm the same identity can list datasets in the Google Cloud Console or with
bq ls --project_id=<PROJECT_ID>.
“Invalid JWT signature” or “Invalid token”
Symptoms:
- Data source test fails immediately
- Error mentions JWT or token validation
- Saving or replacing the service account key fails
- Your organization doesn’t want to store a service account key in Grafana
Solutions:
- Upload a JSON service account key from the Google Cloud Console. P12 keys aren’t supported. The file must include
client_email,private_key, andtoken_uri. - If replacing a key on an existing data source fails, update the BigQuery plugin first, then restart Grafana and try again. Older plugin versions could fail to reset or change the stored JWT.
- Verify the private key in the configuration matches the JSON file, and that
tokenUriishttps://oauth2.googleapis.com/token. - Create a new JSON key in Google Cloud if the current one is corrupted or revoked, then paste or upload it again.
For policies that limit long-lived keys:
- Service account impersonation still stores a JWT, but that key only needs permission to mint tokens. The impersonated account holds BigQuery access. Refer to Service account impersonation.
- GCE Default Service Account stores no key. Use it when Grafana runs on a GCE VM.
- Workload Identity Federation stores no key, but it’s Grafana Cloud only and doesn’t support alerting. Refer to Workload Identity Federation.
“Service account impersonation failed”
Symptoms:
- Queries fail when using service account impersonation
- Error mentions impersonation or token creation
- Only a “Service account email to impersonate” field is visible and it’s unclear how to proceed
Solutions:
- Verify you have configured authentication before enabling impersonation. Service account impersonation requires an underlying authentication method (either Google JWT File or GCE Default Service Account). Upload your authenticating service account’s JSON key first, then under Service account impersonation, turn on Enable.
- Verify the authenticating service account has the Service Account Token Creator role (
roles/iam.serviceAccountTokenCreator) on the impersonated service account. - Ensure the impersonated service account has the required BigQuery roles (BigQuery Data Viewer and BigQuery Job User).
- Check that the impersonated service account email is the full email address (for example,
my-sa@my-project.iam.gserviceaccount.com).
For detailed setup instructions including gcloud commands, refer to Service account impersonation.
Workload Identity Federation authentication failing
Symptoms:
- Queries fail when using Workload Identity Federation (WIF)
- Errors mention token exchange, invalid audience, or the workload identity pool provider
- The project, dataset, or table selectors in the query editor show load errors because the default project can’t be resolved
- Authentication works on interactive dashboards but fails for alerts, scheduled reports, or public dashboards
Solutions:
- Confirm you’re on Grafana Cloud. Workload Identity Federation is available on Grafana Cloud only, because Grafana Cloud exchanges the signed-in user’s OIDC ID token for a short-lived Google Cloud access token before the request reaches the plugin.
- Confirm Grafana Cloud SSO uses the same OIDC provider as the workload identity pool. WIF exchanges that user’s OIDC ID token. If users sign in with Google OAuth and you want to query BigQuery as that Google user, use Forward OAuth Identity instead.
- Verify the Workload Identity Pool Provider resource path is correct and uses the format
projects/<project-number>/locations/global/workloadIdentityPools/<pool-id>/providers/<provider-id>. Use the project number (a numeric ID such as123456789), not the project ID (such asmy-project). - Check the provider’s attribute mappings in Google Cloud. The
google.subjectattribute must map to the correct claim from your identity provider (for example,assertion.sub; the exact mapping depends on your provider’s claim format). - Verify the BigQuery permissions are granted to the correct principal:
- Without impersonation: the WIF pool principal needs the BigQuery Data Viewer and BigQuery Job User roles, and the Service account email field must be left blank.
- With impersonation: the impersonated service account needs the BigQuery Data Viewer and BigQuery Job User roles, the WIF pool principal needs the Service Account Token Creator role on that service account, and the impersonated service account’s full email must be entered in the Service account email field.
- Ensure your Grafana Cloud stack’s SSO integration is configured against the same OIDC provider that the workload identity pool trusts. If the signed-in user’s identity isn’t available, Grafana Cloud can’t exchange it for a Google Cloud access token.
Note
Credentials from Workload Identity Federation are tied to the signed-in user’s active session. There is no long-lived credential available to the Grafana backend, so features that run without a user present don’t work, including alerting, scheduled reports, and public dashboards. If you rely on these features, use a service account key (JWT) instead.
For detailed setup instructions, refer to Workload Identity Federation.
Forward OAuth Identity not working
Symptoms:
- Queries fail when using Forward OAuth Identity
- User sees authentication errors after logging in
- OAuth scopes appear correct in configuration files but authentication still fails
Solutions:
- Verify the OAuth scopes are configured in the Grafana 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.
- If you updated OAuth scopes in a configuration file but the data source still fails, the Grafana database may be storing stale settings that override the file-based configuration. To fix this, open the data source settings in the Grafana UI, re-enter the correct scopes, and click Save & test.
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 the Grafana 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.
Private data source connect (PDC) errors
Symptoms:
socks connect tcp ... network unreachableerror messages- SSH tunnel opens but closes immediately
- Intermittent connection failures when using PDC
- Data source works locally but fails in Grafana Cloud with PDC
Solutions:
- Verify the PDC agent is running and connected. Check the agent logs and the PDC status in your Grafana Cloud instance under Administration > Private data source connect.
network unreachableusually means Grafana Cloud has no connected agent to route through. - Restart the PDC agent if it has disconnected.
- Run more than one PDC agent with the same configuration. A single agent is a single point of failure. For production, Grafana recommends at least three agents so PDC can load-balance and fail over. Refer to Configure PDC.
- If the SSH tunnel opens but immediately closes, this can indicate a plugin installation error rather than a network problem. Verify the BigQuery plugin is correctly installed and not in an error state. Refer to Version and upgrade guidance.
- Ensure the PDC agent’s network allows outbound HTTPS (port 443) to
*.googleapis.com. - For intermittent failures, high latency, or agent overload, follow Troubleshoot PDC issues rather than switching agent install methods. The Docker image includes a supported OpenSSH; the binary requires OpenSSH 9.2 or later (or
-use-gossh).
For general PDC setup, refer to Private data source connect.
Configuration errors
These errors occur during data source setup or provisioning.
Failed to save data source
Symptoms:
- Unable to save data source configuration
- Error when clicking Save & test, including
Failed to save datasource
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 syntax checker).
- Check that
typeis set tografana-bigquery-datasource. - Ensure
authenticationTypematches the credentials provided. - For
privateKeyinsecureJsonData, ensure newlines are preserved (use|for multi-line strings in YAML).
Example with a multi-line 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-----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 query validation 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.
Table outside accessible projects
These errors appear when Restrict to accessible datasets is enabled in the data source settings.
Symptoms:
- The query fails before it runs, with a message about datasets, referenced tables, or
EXECUTE IMMEDIATE - The same SQL works when the restriction is turned off
Possible causes and solutions:
Query timeout
Symptoms:
- Query runs for a long time then fails
- Error mentions timeout or exceeded limits
context deadline exceeded, especially on alerting rules or dashboards with many panels
Possible causes and solutions:
Solutions:
- Optimize the query first. Increasing a timeout doesn’t help a scan of terabytes. Filter on the partition column with
$__timeFilter, use clustered tables, and select only the columns you need. - On self-managed Grafana, you can raise the Grafana timeouts if the query is already efficient:
- Dashboards:
[dataproxy] timeoutingrafana.ini(default30). Refer to timeout. - Alerting:
[unified_alerting] evaluation_timeout(default30s). Refer to theevaluation_timeoutsetting.
- Dashboards:
- Restart Grafana after changing
grafana.ini. - On Grafana Cloud, you typically can’t raise these timeouts. Reduce bytes scanned, or pre-aggregate data in BigQuery.
- For alerting, split heavy rules into separate evaluation groups so they don’t all query BigQuery at the same time. Refer to Performance considerations.
- Add a
LIMITclause while developing queries.
Note
Queries that process terabytes of data likely exceed any reasonable timeout. Refactor the query to reduce data scanned rather than raising the timeout.
“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.
Stale variables in scheduled reports
Symptoms:
- Scheduled reports (Grafana Reporting) use outdated variable values
- Reports always render with the same variable selection instead of refreshing dynamically
- Variable values in the report don’t match what’s currently in BigQuery
Solutions:
- Scheduled reports can cache variable values at the time the report is created. If the underlying BigQuery data changes, the report continues using the original values.
- To force a dynamic refresh at runtime, use the
Grafana Reporting API to clear the report’s saved variable configuration. Remove the
templateVarsfield from the report definition so variables are evaluated fresh at each scheduled run. - Alternatively, recreate the report after updating variable queries to pick up the latest values.
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
- High bytes billed per query
Solutions:
- Use partition filters. Always filter on the partition column using
$__timeFilter(partition_column). Without a partition filter, BigQuery scans the entire table regardless of the dashboard time range. - Narrow the time range. Shorter time ranges scan less data. Use the dashboard time picker to limit the window.
- Avoid
SELECT *. Select only the columns your visualization needs. BigQuery is columnar, so fewer columns means less data scanned. - Add
LIMITduring development. UseLIMITwhen building and testing queries to reduce scan costs. - Use appropriate aggregation intervals. Aggregate data to match the visualization granularity. There’s no benefit in returning per-second data for a chart showing daily trends.
- Set
Max bytes billed. Configure this in Additional Settings to prevent unexpectedly expensive queries from running. - Enable
Restrict to accessible datasets. Configure this in Additional Settings to reject queries that reference tables outside the projects the data source has access to. This blocks queries against public datasets such asbigquery-public-data, which IAM cannot restrict. - 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.
Grafana Cloud vs. self-managed differences
If you are migrating from self-managed Grafana to Grafana Cloud, be aware of the following behavioral differences with the BigQuery plugin.
Dataset and table browsing
On self-managed Grafana, the BigQuery plugin connects directly to Google Cloud APIs. On Grafana Cloud, the connection may route through Private data source connect (PDC) if your BigQuery resources are not publicly accessible. This routing can affect the speed at which datasets and tables load in the query editor drop-downs.
Whether all projects are visible in the project selector depends on service account permissions rather than PDC. Ensure the service account has resourcemanager.projects.get on each project you expect to see listed.
If dataset browsing works on self-managed Grafana but not on Grafana Cloud, verify your PDC agent is running and that the service account permissions are identical between environments.
Query variable substitution
Template variable substitution behavior is consistent between self-managed Grafana and Grafana Cloud. If you observe differences after migration, check:
- The plugin version matches between environments. Older plugin versions may handle multi-value variables differently.
- The data source configuration is identical, particularly the Default project and Processing location settings.
- Variable queries that rely on
$__intervalor time-range macros may produce different results if the default dashboard time range differs between environments.
Auditing and usage tracking
To track which Grafana users are running BigQuery queries:
- Grafana audit logging (available in Grafana Enterprise and Grafana Cloud) can identify the user and data source associated with a query request, but does not log the specific SQL query text or which BigQuery tables were accessed. For details, refer to Auditing.
- BigQuery audit logs in GCP provide full query-level detail, including the SQL text, tables accessed, bytes scanned, and job metadata. Enable Cloud Audit Logs for BigQuery to capture this information.
For complete query-level auditing, use BigQuery’s audit logs. You can correlate them with Grafana audit logs by matching timestamps and the service account identity.
BigQuery metrics in Google Cloud Monitoring
If you use Google Cloud Monitoring to track BigQuery usage metrics (such as bigquery.googleapis.com/query/count or bigquery.googleapis.com/query/execution_times), be aware that GCP attributes these metrics to the project that runs the query job, not the project that hosts the data. This means:
- If your Grafana service account runs jobs in Project A but queries data in Project B, the metrics appear under Project A.
- This is standard GCP metric attribution behavior, not something controlled by the Grafana plugin.
When building Cloud Monitoring dashboards for BigQuery usage, filter by the project configured as the Default project in the BigQuery data source settings (or the project specified in the $__timeFilter query), as that is where job metrics are attributed.
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


