InfluxDB 2 token always missing last bucket in list

Hello all

I’m running InfluxDB v2.9.1 and Grafana 13.0.1

I created two API Tokens for a specific list of buckets.

The tokens work in Grafana but both are showing n-1 so for token 1, Grafana is showing 6 out of 7 buckets (missing the last one) and the same for token 2 which is supposed to show 4 buckets but is showing only 3. Again the last bucket is missing.

I checked the scope in the GUI in InfluxDB and it’s showing the correct buckets.

Is this a bug? If so, is it in InfluxDB or Grafana?

Thanks in advance

Update

I tested using by running:

influx bucket list --host http://localhost:8086 --token

and it only returns 3 out of 4 of the buckets in scope.

This is probably a pagination error. The authorization is applied after the buckets are fetched, up to the limit parameter (defaults to 20), So, imagine the first 20 buckets are fetched, but that list of 20 only contains 4 of the 6 buckets your token lets you see. The result will be 4 buckets listed.

I believe the work-around is to increase the limit in the influx buckets list call so it returns all the buckets in the database, so the ones you want will be found once authorization is applied.

Buckets

Pagination

Issue

See also CLI instructions