Cannot find any bucket with Custom API Token from Grafana

Hello,
I have just tried to add a new datasource in Grafana since many many months using a custom API Token and I get the error:

not found: no buckets found in organization [org ID] error reading buckets

The custom API token is R/W to the specific bucket.
The only way to get this working is to create a Full Access API token. How it is possible?

Influxdb V2 dockerized v. 2.7.11
Grafana dockerized v. 11.5.2

Hello @Ricky99,
Hmmm a R/W bucket should work. I used it the other day with grafana cloud and it worked for me.
I’m not sure. Can you try deleting that R/W token and recreating it? Have you tried that already? Of course I was also using an older version of Grafana I don’t know if a bug was introduced…seems unlikely though.

Hello Anais,
yes, I recreated many times the API token, always failed.

Hi all,

We have recently found this same issue. We have around 20 buckets. We have created a custom API token with read permissions for all buckets. When we use it from Grafana we don’t get all the buckets, buckets() does not return the latest x buckets (ordered by bucket name). If we create a custom API token with read access to one of these missing buckets, we cannot get any data from it (or even the bucket name from buckets()).

Following Grafana InfluxDB Flux query `buckets()` doesn't return all buckets · Issue #70464 · grafana/grafana · GitHub we have created API tokens for all buckets including the “All Orgs” resource and it seems to work as expected. If we create an API token for one of the latest buckets including the “All Orgs” it is not working in Grafana, if we use the InfluxDB API (/api/v2/buckets) we can get the bucket name.

We are using:

  • Grafana v9.5.16
  • InfluxDB v2.6.1

Regards,
Jorge

I have learn that the query that I used in the previous post is not the used by Grafana ( Not all Buckets shown from InfluxDB · Issue #47925 · grafana/grafana · GitHub ). If I use the /api/v2/query request I don’t get the missing buckets.

The problem you’re having probably is a result of your custom API token that you had created in InfluxDB potentially not having sufficient permissions or correct scope to browse the needed buckets in the org. InfluxDB v2 has fine-grained access, and although using a Read/Write (R/W) token should suffice, it may well be that the token does not have the desired permissions to read or query the buckets within Grafana. To fix this, make sure the token has express permissions for “Read” access to the desired bucket(s) and “Query” permissions on the InfluxDB API. Alternatively, as you’ve learned, a Full Access token ignores these limits but is typically advised to utilize the least privilege paradigm by customizing token scopes.