Database not found error


I’ve just signed up to InfluxDB Cloud Serverless and Grafana Cloud, and when trying to set up an InfluxDB data source, I get the following error:

database not found: test-buc-1 error reading influxDB

This is using InfluxQL. If I use SQL, it works.

I’m using an ‘all access’ token. The bucket ‘test-buc-1’ exists.

What am I missing?


@tsmjay InfluxQL does require a bit of extra setup. The InfluxDB/Grafana documentation walks through setting up an InfluxQL datasource: Use Grafana to query and visualize data stored in InfluxDB | InfluxDB Cloud Serverless Documentation.

On this page, there is a note for ‘Map databases and retention policies to buckets’, but if you follow the link, it says:

In InfluxDB Cloud Serverless, the concepts of database and retention policy have been merged into buckets, where buckets have a retention period, but retention policies are no longer part of the data model.

There seem to be various versions of InfluxDB (including the InfluxDB storage engine) and the HTTP API. Is it possible that InfluxDB Cloud Serverless (InfluxDB 3.0) uses an InfluxDB v1 or v2 HTTP API?

There are multiple APIs and InfluxDB Cloud Serverless supports the v1, v2, and v3 APIs in limited ways. For example, it supports all v1, v2, and v3 write APIs, but only v1 (InfluxQL) and v3 (SQL) query APIs.

InfluxQL still expects a database and retention policy to be specified in the query request or in the query itself. For example:

SELECT * FROM db.rp.measurement

InfluxQL itself doesn’t know about the change of the underlying data model. It just works based on patterns established in InfluxDB v1. So you have to map a db/rp combination to point to the correct bucket to query.

If you have the v2 influx CLI installed, you can use the following command to create the DBRP mapping:

influx v1 dbrp create \
  --org <YOUR_ORG_ID> \
  --db test-buc-1 \
  --rp autogen \
  --bucket-id <test-buc-1_BUCKET_ID> \
1 Like

After a lot of trial and error, I’ve finally got it working.

The documentation makes this very confusing.

Even though InfluxDB Cloud Serverless uses InfluxDB 3.0, InfluxQL interfaces with it using the InfluxDB 1.0 HTTP API.

This means that, for anything using InfluxQL, the concepts of ‘databases’ and ‘retention policies’ still apply.

In order to connect to InfluxDB Cloud Serverless using InfluxQL, you need to associate a database and retention policy with a bucket.

One way to do that is using the instructions listed here.

InfluxData really need to work on their communication.