Documentation

Troubleshoot InfluxQL errors

Learn how to troubleshoot and fix common InfluxQL errors.

Disclaimer: This document does not contain an exhaustive list of all possible InfluxQL errors.

error: database name required

error: database name required

Cause

The database name required error occurs when certain SHOW queries do not specify a database in the query or with the query request.

For example, the following SHOW query doesn’t specify the database and assumes the db is not specified in the /query API request:

SHOW MEASUREMENTS

Solution

To resolve this error, specify a database with your query request by doing one of the following:

  • Include an ON clause with the SHOW statement that specifies the database to query:

    SHOW MEASUREMENTS ON 
    DATABASE_NAME
  • If using the InfluxDB v1 query API, Include the db query parameter in your request:

    curl --get https://cloud2.influxdata.com/query \
      --header "Authorization: Bearer 
    DATABASE_TOKEN
    "
    \
    --data-urlencode "db=
    DATABASE_NAME
    "
    \
    --data-urlencode "q=SHOW MEASUREMENTS"

Related: InfluxQL SHOW statements, Explore your schema with InfluxQL


error parsing query: found …, expected identifier at …

error parsing query: found EXAMPLE, expected identifier at line 1, char 14

Causes

This error occurs when InfluxDB anticipates an identifier in a query but doesn’t find it. Identifiers are tokens that refer to database names, retention policy names, measurement names, field keys, and tag keys.

This error is generally caused by one of the following:

A required identifier is missing

Some InfluxQL statements and clauses require identifiers to identify databases, measurements, tags, or fields. If the statement is missing a required identifier, the query returns the expected identifier error.

For example, the following query omits the measurement name from the FROM clause:

SELECT * FROM WHERE color = 'blue'
Solution

Update the query to include the expected identifier in the FROM clause that identifies the measurement to query:

SELECT * FROM measurement_name WHERE color = 'blue'

A string literal is used instead of an identifier

In InfluxQL, string literals are wrapped in single quotes ('') while character sequences wrapped in double quotes ("") are parsed as identifiers. If you use single quotes to wrap an identifier, the identifier is parsed as a string literal and returns the expected identifier error.

For example, the following query wraps the measurement name in single quotes:

SELECT * FROM 'measurement-name' WHERE color = 'blue'

Results in the following error:

error parsing query: found measurement-name, expected identifier at line 1, char 14
Solution

Update single-quoted identifiers to use double quotes so they are parsed as identifiers and not as string literals.

SELECT * FROM "measurement-name" WHERE color = 'blue'

An InfluxQL keyword is used as an unquoted identifier

InfluxQL keyword are character sequences reserved for specific functionality in the InfluxQL syntax. It is possible to use a keyword as an identifier, but the identifier must be wrapped in double quotes ("").

While wrapping identifiers that are InfluxQL keywords in double quotes is an acceptable workaround, for simplicity, you should avoid using InfluxQL keywords as identifiers.

SELECT duration FROM runs

Returns the following error:

error parsing query: found DURATION, expected identifier, string, number, bool at line 1, char 8
Solution

Double quote InfluxQL keywords when used as identifiers:

SELECT "duration" FROM runs

Related: InfluxQL keywords, Query Language Documentation


error parsing query: mixing aggregate and non-aggregate queries is not supported

error parsing query: mixing aggregate and non-aggregate queries is not supported

Cause

The mixing aggregate and non-aggregate error occurs when a SELECT statement includes both an aggregate function and a standalone field key or tag key.

Aggregate functions return a single calculated value per group and column and there is no obvious single value to return for any un-aggregated fields or tags.

For example, the following example queries two fields from the home measurement–temp and hum. However, it only applies the aggregate function, MEAN to the temp field.

SELECT MEAN(temp), hum FROM home

Solution

To fix this error, apply an aggregate or selector function to each of the queried fields:

SELECT MEAN(temp), MAX(hum) FROM home

Related: InfluxQL functions, Aggregate data with InfluxQL


invalid operation: time and *influxql.VarRef are not compatible

invalid operation: time and *influxql.VarRef are not compatible

Cause

The time and \*influxql.VarRef are not compatible error occurs when date-time strings are double-quoted in a query. Date-time strings should be formatted as string literals and wrapped in single quotes ('').

For example:

```sql SELECT temp FROM home WHERE time >= "2022-01-01T08:00:00Z" AND time <= "2022-01-01T00:20:00Z" ```

Returns the following error:

invalid operation: time and *influxql.VarRef are not compatible

Solution

To fix the error, wrap RFC3339 timestamps in single quotes rather than double quotes.

```sql SELECT temp FROM home WHERE time >= '2022-01-01T08:00:00Z' AND time <= '2022-01-01T00:20:00Z' ```

Related: Query data within time boundaries, WHERE clause–Time ranges, InfluxQL time syntax


Was this page helpful?

Thank you for your feedback!


InfluxDB OSS 2.9.0: API tokens are hashed by default

Stronger token security in InfluxDB OSS 2.9.0 — tokens are hashed on disk by default. Existing tokens are hashed on first startup and can’t be recovered afterward. Capture any plaintext tokens you still need before you upgrade.

View InfluxDB OSS 2.9.0 release notes

Hashed tokens authenticate exactly like unhashed tokens — clients and integrations keep working.

Also new in 2.9.0:

  • Configurable backup compression
  • Restore support for backups containing hashed tokens
  • Tighter Edge Data Replication queue validation
  • Flux upgrade
  • Compaction reliability improvements

Key enhancements in Explorer 1.8

Explorer 1.8 is now available with streaming data subscriptions (beta), line protocol preview, and query history & saved queries.

View Explorer 1.8 release notes

Explorer 1.8 includes new features and improvements that make it easier to ingest, explore, and manage data.

Highlights:

  • Streaming data subscriptions (beta): Stream data into Explorer from MQTT, Kafka, and AMQP sources.
  • Line protocol preview: Preview line protocol, schema, and parse errors before data is written.
  • Custom sample data: Generate custom sample datasets with line protocol and schema preview.
  • Query history and saved queries: Browse query history and save/re-run named queries.
  • Retention period management: Set, update, or clear retention periods on databases and tables.

For more details, see Explorer 1.8 release notes

InfluxDB 3.9: Performance upgrade preview

InfluxDB 3 Enterprise 3.9 includes a beta of major performance upgrades with faster single-series queries, wide-and-sparse table support, and more.

InfluxDB 3 Enterprise 3.9 includes a beta of major performance and feature updates.

Key improvements:

  • Faster single-series queries
  • Consistent resource usage
  • Wide-and-sparse table support
  • Automatic distinct value caches for reduced latency with metadata queries

Preview features are subject to breaking changes.

For more information, see:

Telegraf Enterprise now in public beta

Get early access to the Telegraf Controller and provide feedback to help shape the future of Telegraf Enterprise.

See the Blog Post

The upcoming Telegraf Enterprise offering is for organizations running Telegraf at scale and is comprised of two key components:

  • Telegraf Controller: A control plane (UI + API) that centralizes Telegraf configuration management and agent health visibility.
  • Telegraf Enterprise Support: Official support for Telegraf Controller and Telegraf plugins.

Join the Telegraf Enterprise beta to get early access to the Telegraf Controller and provide feedback to help shape the future of Telegraf Enterprise.

For more information:

Telegraf Controller v0.0.7-beta now available

Telegraf Controller v0.0.7-beta is now available with new features, improvements, bug fixes, and an important breaking change.

View the release notes
Download Telegraf Controller v0.0.7-beta

InfluxDB Docker latest tag changing to InfluxDB 3 Core

On May 27, 2026, the latest tag for InfluxDB Docker images will point to InfluxDB 3 Core. To avoid unexpected upgrades, use specific version tags in your Docker deployments.

If using Docker to install and run InfluxDB, the latest tag will point to InfluxDB 3 Core. To avoid unexpected upgrades, use specific version tags in your Docker deployments. For example, if using Docker to run InfluxDB v2, replace the latest version tag with a specific version tag in your Docker pull command–for example:

docker pull influxdb:2

InfluxDB Cloud Serverless