Unable to add second data source to the same Influxdb

Grafana v9.3.2 in a Docker container
InfluxDB v2.6.1 in a Docker container

I have two docker containers, one with InfluxDB (2 buckets) and the second with Grafana. They are working fine, I can build nice graphs based on data of one bucket in Influx.
But when I try to add a second data source with a different bucket from the same Influx it fails to connect
In UI error is: error reading InfluxDB. Status Code: 401
In (Docker) log file:
logger=tsdb.influxdb t=2023-01-23T10:00:58.278962845Z level=warn msg=“error performing influxdb healthcheck” err="error reading InfluxDB. Status Code: 40

logger=context userId=1 orgId=1 uname=admin t=2023-01-23T09:55:00.514294059Z level=info msg=“Request Completed” method=GET path=/api/datasources/2/health status=400 remote_addr=10.100.125.42 time_ms=1 duration=1.718836ms size=72 referer=http://10.100.125.19:3000/datasources/edit/uElrTOo4k handler=/api/datasources/:id/health

Both data source configurations are identical (except for bucket name).
If I put a non-working bucket to a working data source, then it works.

Hi @andreipugatsov,
Can you check if used token have read permissions on bucket which you are trying to add as data source to grafana?

Best regards,
ldrascic

1 Like

Hi @ldrascic,

I didn’t find how to see a bucket-permission realtionship.
Token I’m using was created as DOCKER_INFLUXDB_INIT_ADMIN_TOKEN, I guess it has access to all bucket or am I wrong?

Regards,
Andrei

Hi @andreipugatsov I agree that an Admin (all access token) should work, but I noticed that it appears that when one selects Custom Token, there is an option for which bucket(s) to select…

Does your all access (admin) token look like this?

1 Like

Hi @grant2,

I’ve made a new custom token with permissions for this bucket and it worked, thank you!

Andrei