This is documentation for the next version of Grafana documentation. For the latest stable release, go to the latest version.
Troubleshoot InfluxDB data source issues
This document provides solutions to common issues you may encounter when configuring or using the InfluxDB data source. Issues are organized to follow the typical setup and usage workflow. For configuration instructions, refer to Configure the InfluxDB data source.
Connection errors
The following errors occur when Grafana can’t establish or maintain a connection to InfluxDB.
“Plugin health check failed” or “An error occurred within the plugin”
Symptoms:
- All panels using InfluxDB return “An error occurred within the plugin”
- Adding a new InfluxDB data source fails with “Plugin health check failed”
- Connection settings appear blank in the UI
Possible causes and solutions:
Failed to connect to InfluxDB
Error message: error performing influxQL query or error performing flux query or error performing sql query
Cause: Grafana can’t establish a network connection to the InfluxDB server.
Solution:
- Verify that the InfluxDB URL is correct in the data source configuration.
- Check that InfluxDB is running and accessible from the Grafana server.
- Ensure the URL includes the protocol (
http://orhttps://). - Verify the port is correct (the InfluxDB default API port is
8086). - Ensure there are no firewall rules blocking the connection.
- For Grafana Cloud, ensure you have configured Private data source connect if your InfluxDB instance is not publicly accessible.
PDC connection fails with “no such host”
Error message: socks connect tcp ... -> influxdb.host:8086: dial tcp: lookup ... no such host
Cause: When using Private data source connect (PDC), the InfluxDB URL can’t be resolved through the SOCKS proxy tunnel.
Solution:
- Don’t use
127.0.0.1orlocalhostas the InfluxDB URL. PDC tunnels traffic over a SOCKS proxy, which can’t resolve loopback addresses. - Use the machine’s LAN IP address or a resolvable hostname instead.
- Verify the hostname is resolvable from the network where the PDC agent is running.
- If the error appeared suddenly without configuration changes, check the Grafana Cloud status page for active incidents.
PDC connection stops working after certificate renewal fails
Symptoms:
- A previously working PDC-connected data source stops working
- The PDC agent logs show errors renewing or signing the SSH certificate
- Queries fail with SOCKS proxy connection errors
Cause: The PDC agent uses a Grafana Cloud API token to periodically renew its SSH certificate. If the token is incorrect, has expired, or has been deleted, certificate renewal fails and the connection stops working when the current certificate expires.
Solution:
- Check the PDC agent logs for authentication or certificate signing errors.
- Verify the API token in the PDC agent configuration is valid. If the token has expired or been deleted, generate a new one from your PDC connection page in Grafana Cloud and update the agent configuration.
- Restart the PDC agent after updating the token.
- Refer to Troubleshoot PDC issues for agent error codes, log interpretation, and token management guidance.
TLS certificate errors
Error message: x509: certificate signed by unknown authority or similar TLS verification errors
Cause: InfluxDB presents a TLS certificate that isn’t signed by a certificate authority (CA) that the Grafana server trusts. This is common with self-signed certificates and internal corporate certificate authorities. TLS verification applies end to end, so this error also occurs when you connect through PDC.
Solution:
- The InfluxDB data source supports TLS configuration for each data source instance. In the data source settings, expand Auth and TLS/SSL Settings, enable CA cert, and paste your CA certificate. Refer to Auth and TLS/SSL settings for details.
- If your InfluxDB server requires client certificates, enable TLS client auth and provide the server name, client certificate, and client key.
- As a last resort, you can enable Skip TLS verify to bypass certificate validation. Grafana doesn’t recommend this for production use because it disables protection against man-in-the-middle attacks.
Request timed out
Error message: context deadline exceeded or request timeout or dial tcp <IP>:<port>: i/o timeout
Cause: The connection to InfluxDB timed out before receiving a response. This is common after Grafana upgrades when infrastructure changes (such as database host migrations) happen at the same time.
Solution:
- Verify network connectivity from the Grafana server to your InfluxDB endpoint. Check DNS resolution, firewall rules, and port access.
- Confirm the InfluxDB host IP address or hostname hasn’t changed. This is especially important after infrastructure migrations or Grafana upgrades.
- Check the network latency between Grafana and InfluxDB.
- Verify that InfluxDB is not overloaded or experiencing performance issues.
- Increase the timeout setting in the data source configuration under Advanced HTTP Settings.
- Reduce the time range or complexity of your query.
Authentication errors
The following errors occur when there are issues with authentication credentials or permissions.
Unauthorized (401)
Error message: “401 Unauthorized” or “authorization failed”
Cause: The authentication credentials are invalid or missing. Transient network issues can also surface as authentication errors even when your credentials are valid.
Solution:
- If the error is intermittent or appeared without a configuration change, wait a few minutes and retry Save & test to rule out a transient network issue before rotating credentials.
- Verify that the token or password is correct in the data source configuration.
- For Flux and SQL, ensure the token has not expired.
- For InfluxQL with InfluxDB 2.x, verify the token is set as an
Authorizationheader with the valueToken <your-token>. - For InfluxDB 1.x, verify the username and password are correct.
- Check that the token has the required permissions to access the specified bucket or database.
Forbidden (403)
Error message: “403 Forbidden” or “access denied”
Cause: The authenticated user or token doesn’t have permission to access the requested resource.
Solution:
- Verify the token has read access to the specified bucket or database.
- Check the token’s permissions in the InfluxDB UI under API Tokens.
- Ensure the organization ID is correct for Flux queries.
- For InfluxQL with InfluxDB 2.x, verify the DBRP mapping is configured correctly.
Configuration errors
The following errors occur when the data source is not configured correctly.
URL not configured
Error message: missing URL from datasource configuration
Cause: The data source URL field is empty.
Solution:
- Open the data source configuration in Grafana.
- Enter the full URL of your InfluxDB instance in the URL field, including the protocol and port (for example,
http://localhost:8086). - Click Save & test to verify the connection.
Unknown influx version
Error message: “unknown influx version”
Cause: The query language is not properly configured in the data source settings.
Solution:
- Open the data source configuration in Grafana.
- Verify that a valid query language is selected: Flux, InfluxQL, or SQL.
- Match the query language to your InfluxDB version:
Each query language uses a different API endpoint. If you select the wrong language for your InfluxDB version, health checks and queries fail.
Invalid data source info received
Error message: invalid data source info received
Cause: The data source configuration is incomplete or corrupted.
Solution:
- Delete and recreate the data source.
- Ensure all required fields are populated based on your query language:
- Flux: URL, Organization, Token, Default Bucket
- InfluxQL: URL, Database, User, Password
- SQL: URL, Database, Token
DBRP mapping required
Error message: “database not found” or queries return no data with InfluxQL on InfluxDB 2.x
Cause: InfluxQL queries on InfluxDB 2.x require a Database and Retention Policy (DBRP) mapping.
Solution:
- Create a DBRP mapping in InfluxDB using the CLI or API.
- Refer to Manage DBRP Mappings for guidance.
- Verify the database name in Grafana matches the DBRP mapping.
Browser access mode disabled
Error message: Direct browser access in the InfluxDB datasource is no longer available. Switch to server access mode.
Cause: The data source is configured for direct browser access, which is no longer supported.
Solution:
- Open the data source configuration in Grafana.
- Change the access mode to Server (default).
- Click Save & test to verify the connection.
Content Security Policy (CSP) violation
Symptoms:
- CSP violation errors in the browser console referencing the InfluxDB plugin
net::ERR_ABORTEDon proxy requests- The InfluxDB plugin attempts direct browser-to-InfluxDB connections
Cause: You’re running an outdated version of Grafana. Browser access mode was removed in Grafana 9.2.0, and older versions may attempt direct browser connections that violate CSP policies. Current versions of the data source support only server (proxy) access, where the Grafana server sends all queries to InfluxDB and the browser never connects to InfluxDB directly.
Solution:
- Upgrade to the latest stable Grafana release. The InfluxDB data source requires Grafana 12.3.0 or later.
- After upgrading, verify the data source access mode is set to Server (default).
Health check errors
The following errors occur when clicking Save & test to validate the data source connection. Each query language uses a different health check query.
Flux health check errors
“error performing flux query”
Cause: The health check query buckets() failed to execute.
Solution:
- Verify the InfluxDB URL is correct and reachable.
- Check that the token is valid and has not expired.
- Ensure the organization ID is correct.
“error reading buckets”
Cause: The buckets() query executed but returned an error.
Solution:
- Verify the token has permission to list buckets.
- Check that the organization ID matches the token’s organization.
“error getting flux query buckets”
Cause: The buckets() query executed without error but returned no data.
Solution:
- Verify the token has permission to list buckets.
- Check that the organization ID is correct.
- Ensure InfluxDB is running and accessible.
InfluxQL health check errors
“error performing influxQL query”
Cause: The health check query SHOW MEASUREMENTS failed to execute.
Solution:
- Verify the InfluxDB URL is correct and reachable.
- Check the username and password (or token for InfluxDB 2.x).
- Verify the database name exists.
“error reading influxDB”
Cause: The SHOW MEASUREMENTS query executed but returned an error.
Solution:
- Verify the database name is correct.
- Check that the user has permission to run
SHOW MEASUREMENTS. - For InfluxDB 2.x, verify DBRP mapping is configured.
“error connecting InfluxDB influxQL”
Cause: The health check completed but the response couldn’t be processed.
Solution:
- Verify the database name is correct.
- Check that the user has permission to run
SHOW MEASUREMENTS. - Ensure the database exists and contains measurements.
- For InfluxDB 2.x, verify DBRP mapping is configured.
SQL health check errors
“error performing sql query”
Cause: The health check query select 1 failed to execute against the FlightSQL endpoint.
Solution:
- Verify the InfluxDB URL is correct. The SQL health check connects via gRPC (FlightSQL).
- Check the token is valid and has the required permissions.
- If using TLS, verify the certificate configuration. Toggle Insecure Connection if connecting without TLS.
- Ensure the InfluxDB 3.x instance is running and the FlightSQL endpoint is accessible.
0 measurements found
Error message: datasource is working. 0 measurements found
Cause: The connection is successful, but the database contains no measurements.
Solution:
- Verify you are connecting to the correct database.
- Check that data has been written to the database.
- If the database is new, add some test data to verify the connection.
Query errors
The following errors occur when there are issues with query syntax or execution.
Query syntax error
Error message: “error parsing query: found THING” or “failed to parse query: found WERE, expected ; at line 1, char 38”
Cause: The query contains invalid syntax.
Solution:
Check your query syntax for typos or invalid keywords.
For InfluxQL, verify the query follows the correct syntax:
SELECT <field> FROM <measurement> WHERE <condition>For SQL, verify your query uses standard SQL syntax supported by InfluxDB 3.x. Common issues include using InfluxQL-specific syntax (such as
GROUP BY time()) in SQL mode. Refer to the InfluxDB SQL reference for supported functions.For Flux, ensure proper pipe-forward syntax and function calls.
Use the InfluxDB UI or CLI to test your query directly.
Query timeout limit exceeded
Error message: “query-timeout limit exceeded”
Cause: The query took longer than the configured timeout limit in InfluxDB.
Solution:
- Reduce the time range of your query.
- Add more specific filters to limit the data scanned.
- Increase the query timeout setting in InfluxDB if you have administrator access.
- Optimize your query to reduce complexity.
Too many series or data points
Error message: “max-series-per-database limit exceeded” or “A query returned too many data points and the results have been truncated”
Cause: The query is returning more data than the configured limits allow.
Solution:
- Reduce the time range of your query.
- Add filters to limit the number of series returned.
- Increase the Max series setting in the data source configuration under Advanced Database Settings.
- Use aggregation functions to reduce the number of data points.
- For SQL, use
$__dateBin(time)to aggregate data into time buckets and reduce cardinality. - For Flux, use
aggregateWindow()to downsample data.
FlightSQL errors (SQL query language)
Error message: Messages prefixed with "flightsql: " followed by a gRPC error description.
Cause: The SQL (FlightSQL) backend encountered an error communicating with InfluxDB 3.x.
Possible causes and solutions:
No time column found
Error message: “no time column found”
Cause: The query result doesn’t include a time column, which is required for time-series visualization.
Solution:
- Ensure your query includes a time field.
- For Flux, verify the query includes
_timein the output. - For SQL, ensure the query returns a timestamp column.
- Check that the time field is not being filtered out or excluded.
Annotation errors
The following errors occur when using InfluxDB annotations on dashboards.
“Query missing in annotation definition”
Cause: The annotation query field is empty.
Solution:
Navigate to the dashboard you want to update and click Edit.
Click the Dashboard options icon to open the sidebar.
Expand the Annotations section.
Select the InfluxDB annotation.
Click Open query editor to open the Annotation Query dialog box.
Enter a valid query in the InfluxQL Query field. The query must include
WHERE $timeFilter. For example:SELECT title, description FROM events WHERE $timeFilter ORDER BY time ASC
“Flux requires the standard annotation query”
Cause: A Flux data source is using the legacy InfluxQL annotation editor instead of the standard Flux query editor.
Solution:
Delete the existing annotation query.
Create a new annotation query and select your Flux-configured InfluxDB data source.
Write a Flux query that returns data frames with time and text fields. For example:
from(bucket: "events") |> range(start: v.timeRangeStart, stop: v.timeRangeStop) |> filter(fn: (r) => r["_measurement"] == "deployments")
Annotations don’t appear on the graph
Cause: Annotations are configured but aren’t visible on the dashboard.
Solution:
- Verify the annotation query returns data by testing it in Explore.
- Check the dashboard time range covers the time period of your annotation events.
- Ensure the annotation toggle is enabled in the dashboard (check the annotation icon in the top menu bar).
- For InfluxQL, confirm the query includes
WHERE $timeFilter. - If your query returns multiple columns, verify the field mappings (Text, Tags, TimeEnd) are set correctly.
Alerting errors
The following errors occur when using InfluxDB queries with Grafana Alerting.
Alert rule fails with template variable errors
Cause: The alert query contains template variables such as $hostname or $region.
Solution:
Alert queries can’t use template variables because Grafana evaluates alert rules on the backend without dashboard context. Replace template variables with hard-coded values:
- Open the alert rule.
- Replace any
$variablereferences with literal values. - Save the alert rule.
If you need the same query in both a dashboard panel and an alert rule, maintain two separate queries: one with variables for the dashboard and one with hard-coded values for alerting.
Alert evaluation returns “no data”
Cause: The alert query doesn’t return time-series data that Grafana can evaluate.
Solution:
- Test the query in Explore first to verify it returns data.
- For InfluxQL, ensure the query uses an aggregation function (such as
mean,sum,count) withGROUP BY time($__interval). - For Flux, use
aggregateWindow()to produce time-bucketed results. - For SQL, use
$__dateBin(time)or$__timeGroup(time)to aggregate by time. - Check that the alert evaluation time range contains data. Alerts use a fixed time range, not the dashboard’s time picker.
- Verify the data source connection is working by clicking Save & test in the data source settings.
Template variable errors
The following issues occur when using template variables with InfluxDB queries.
Variable drop-down shows stale or historical values
Cause: Metadata queries such as SHOW TAG VALUES return values from the entire retention period, not just the dashboard time range. Hosts or sensors that stopped reporting long ago still appear in the drop-down.
Solution:
- Add a time condition to the variable query, such as
WHERE $timeFilterfor InfluxQL orWHERE $__timeFilter(time)for SQL. - Set the variable’s Refresh option to On time range change.
- Refer to Scope variables to the dashboard time range for examples.
Multi-select variable breaks the query
Cause: When a variable has the Multi-value or Include all value option enabled, Grafana interpolates the selected values as a regular expression group, such as (server1|server2). Queries that compare with = or that don’t wrap the variable in a regular expression fail or return no data.
Solution:
- For InfluxQL, use the
=~operator and wrap the variable in a regular expression:"hostname" =~ /^$host$/. - For SQL, use the
INoperator:host IN ($host). - Refer to Choose a variable syntax for working examples.
Variable values are escaped unexpectedly
Cause: Grafana escapes special characters in variable values when the variable is multi-value or used inside a regular expression. Custom variable values that intentionally contain special characters, such as paths or expressions, arrive at InfluxDB modified.
Solution:
Use the raw format option, such as ${path:raw}, to interpolate the literal value without escaping. Refer to
Prevent unwanted value escaping for details.
Variable drop-down contains a blank or duplicate entry
Cause: The variable query returns duplicate values. Grafana deduplicates results, but depending on the plugin version, duplicates can surface as a blank entry in the drop-down.
Solution:
- Update the variable query to return unique values. For SQL, use
SELECT DISTINCT. For InfluxQL,SHOWmetadata queries already return unique values, so check for duplicates across retention policies. - Alternatively, use the variable’s Regex option to filter the results.
Other common issues
The following issues don’t produce specific error messages but are commonly encountered during day-to-day use.
“Data source was not found”
Symptoms:
- Dashboard panels display “data source <UID> was not found”
- Manually re-running queries in the panel editor works after you select the data source again
Cause: Dashboard panels reference an old or deleted data source UID. This happens when a data source is deleted and recreated, since the new data source gets a different UID. Dashboard schema migrations can also leave panels with invalid data source references, so verify your panels after a dashboard is migrated to a new schema version.
Solution:
- Find the current UID of your InfluxDB data source. Navigate to Connections > Data sources, open the data source, and copy the UID from the page URL.
- To find every stale reference at once, open the dashboard’s JSON model from the dashboard settings and search for the UID shown in the panel error message.
- Fix the references by editing each affected panel and selecting the correct InfluxDB data source from the drop-down again, or by replacing the stale UID in the JSON model and saving the dashboard.
- To avoid this issue, update existing data sources instead of deleting and recreating them.
404 Not Found when sending Telegraf metrics to Grafana Cloud
Error message: “404 Not Found” when Telegraf writes to the Grafana Cloud InfluxDB-compatible endpoint.
Cause: The Telegraf influxdb_v2 output plugin isn’t compatible with the Grafana Cloud metrics endpoint. This commonly occurs when using PrivateLink or the standard InfluxDB-compatible write endpoint.
Solution:
- Switch the Telegraf output plugin from
influxdb_v2toinfluxdb(v1) in your Telegraf configuration. - Ensure the endpoint URL and credentials match those shown in your Grafana Cloud InfluxDB configuration page.
- Restart Telegraf after making the change.
Empty query results
Cause: The query returns no data.
Solution:
- Verify the time range includes data in your database.
- Check that the measurement and field names are correct. For SQL, table names in InfluxDB 3.x are case-sensitive.
- Test the query directly in the InfluxDB UI or CLI.
- Ensure filters are not excluding all data.
- For SQL, verify the
$__timeFilter(time)macro is included so the query uses the dashboard time range. - For InfluxQL, verify the retention policy contains data for the selected time range.
Numeric values stored as strings display a blank panel
Symptoms:
- Time series panels show no data even though the query returns results
- Values appear in the table view but can’t be graphed
Cause: InfluxDB sets a field’s data type when the field is first written. If numeric values were written as strings, for example quoted in line protocol, InfluxDB returns them as strings and Grafana can’t graph them. This is a data issue in InfluxDB, not in Grafana.
Solution:
- As a workaround, add the Convert field type transformation to the panel and convert the field to Number.
- To fix the root cause, correct the data type at write time. InfluxDB can’t change the type of an existing field, so you may need to write the data to a new field or measurement.
- In older Grafana versions, the Convert field type transformation converted null values to zeros. Current versions preserve null values. If you see nulls displayed as zeros after conversion, upgrade Grafana.
Panel values differ between view and edit mode
Cause: Grafana calculates the query interval ($__interval) from the time range and the maximum number of data points, which is based on the panel’s width. A panel rendered in edit mode has a different width than in the dashboard view, so queries that group by time($__interval) can aggregate into different bucket sizes and display different values. Both results are correct. They’re aggregated at different resolutions.
Solution:
- To make values consistent, set a fixed Min interval or Max data points value in the panel’s query options.
- Alternatively, use an explicit interval in the query, such as
GROUP BY time(1m)instead ofGROUP BY time($__interval).
Legend or tooltip colors don’t match the series
Cause: The query returns multiple series with the same name. This commonly happens when a query doesn’t group by the tags that differentiate series, or when an alias hides the distinguishing information. Grafana assigns colors and tooltip values by series name, so duplicate names cause the legend and hover tooltip to display mismatched colors or values.
Solution:
- Group by the tags that make each series unique, such as
GROUP BY "hostname". - Use alias patterns such as
$tag_hostnamein the ALIAS field so each series has a unique display name. Refer to Alias patterns for details. - Use the panel inspector to confirm each returned series has a distinct name.
Slow query performance
Cause: Queries take a long time to execute.
Solution:
- Reduce the time range of your query.
- Add more specific filters to limit the data scanned.
- Increase the Min time interval setting to reduce the number of data points.
- Check InfluxDB server performance and resource utilization.
- For SQL, use
$__dateBin(time)with aggregation functions to downsample data. AddWHEREclauses to narrow the query scope. - For Flux, use
aggregateWindow()to downsample data before visualization. - Consider using continuous queries or tasks to pre-aggregate data.
InfluxDB receives a high volume of queries from Grafana
Symptoms:
- Unexpected query load on your InfluxDB server
- You’re unsure whether the traffic originates from Grafana
Cause: Every panel on a dashboard sends its queries to InfluxDB each time the dashboard refreshes. Query volume scales with the number of panels, the number of queries per panel, the refresh interval, and the number of people viewing the dashboard at the same time. For example, a dashboard with 20 panels refreshing every 10 seconds generates at least 120 queries per minute for each viewer.
Solution:
- Increase the dashboard refresh interval or turn off auto-refresh where it isn’t needed.
- Reduce the number of panels and queries per dashboard.
- Increase the Min time interval setting to reduce the resolution of each query.
- In Grafana Enterprise and Grafana Cloud, enable query caching so identical queries within the cache window are served from cache instead of hitting InfluxDB.
- To confirm whether traffic originates from your Grafana Cloud instance, compare the source IP addresses against the Grafana Cloud allowlist.
Data appears delayed or missing recent points
Cause: The visualization doesn’t show the most recent data.
Solution:
- Check the dashboard time range and refresh settings.
- Verify the Min time interval is not set too high.
- Ensure InfluxDB has finished writing the data.
- Check for clock synchronization issues between Grafana and InfluxDB.
Enable debug logging
Caution
InfluxDB plugin versions earlier than 13.1.0 could write API tokens to Grafana server logs in plain text at default log levels. Before troubleshooting with logs, upgrade to plugin version 13.1.0 or later. Treat log files as sensitive, and rotate any tokens that may have been exposed.
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 InfluxDB-specific entries that 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 guide and still encounter issues:
- Check the InfluxDB documentation for API-specific guidance.
- Review the Grafana community forums for similar issues.
- Review InfluxDB data source issues on GitHub for known bugs.
- Contact Grafana Support if you’re an Enterprise, Cloud Pro, or Cloud Contracted user.
- When reporting issues, include:
- Grafana version
- InfluxDB data source plugin version, found on the Administration > Plugins page
- InfluxDB version and product (OSS, Cloud, Enterprise)
- Query language (Flux, InfluxQL, or SQL)
- Error messages (redact sensitive information)
- Steps to reproduce
- Relevant configuration such as data source settings, HTTP method, and TLS settings (redact tokens, passwords, and other credentials)


