Same InfluxDB Data source configuration created in Grafana 11 doesn't work in Grafana 12

  • What Grafana version and what operating system are you using?
    Grafana Cloud 12.1.0-91295
  • What are you trying to achieve?
    Create a new InluxDB Data Source.
  • How are you trying to achieve it?
    Copy/paste the configuration from another InfluxDB Data source created in Grafana cloud 11.
  • What happened?
    Not able to connect to DB, with errors:
    “There was an error when testing this data source, please check PDC agent logs.”
    “InfluxDB returned error: Unauthorized error reading influxDB”

PDC logs shows that it is connected:
Jul 17 19:46:30 grafanagw pdc[3325]: level=info caller=ssh.go:304 ts=2025-07-17T19:46:30.184877031Z msg=“debug1: channel 1: connected to drm-librenms.cec.delllabs.net port 8086”

  • What did you expect to happen?
    Same as the original Data Source (created with Grafana 11), when “Save & test” get the connections working and retrive data: “datasource is working. 160 measurements found”

  • Can you copy/paste the configuration(s) that you are having problems with?
    N/A

  • Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.
    Yes, we get an error:
    “There was an error when testing this data source, please check PDC agent logs.
    InfluxDB returned error: Unauthorized error reading influxDB”

  • Did you follow any online instructions? If so, what is the URL?No

thanks!
Ruben

You can try this solution to fix your issue. I hope it will be helpful for you.
Step : Identify InfluxDB Version
Check which version of InfluxDB you’re using:

InfluxDB 1.x → uses username + password
InfluxDB 2.x → uses authentication token, organization, and bucket
Step : 2 Re-enter Auth info in grafana
Log in to Grafana Cloud.
Go to Connections > Data sources.
Find your new InfluxDB data source.

Update these fields:

URL: usually http://localhost:8086 (through PDC), or your actual InfluxDB hostname
Auth Type: set to Token
RE-ENTER the token manually
your InfluxDB org name
your InfluxDB bucket name

If it still fails with Unauthorized, double-check the token/password and InfluxDB logs.
Step : 3 Test Token Manually
If you’re using InfluxDB 2.x, test the token manually:

curl -i -X POST http://<influx_host>:8086/api/v2/query \
  -H "Authorization: Token <your-token>" \
  -H "Content-Type: application/vnd.flux" \
  -d 'from(bucket:"<your-bucket>") |> range(start: -1h)'

Thanks, Shanker,

That was exactly our problem. We were not using tokens, but there was something else, not any generic token worked (one for “all buckets”), we had to create one just for our bucket and that worked.

Thanks again or your help

Ruben