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?
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.