PhilippG
PhilippG

Reputation: 81

Grafana Publix Dashboard: Data Source not found

I am trying to use Grafana public Dashboards. First some infos:

  1. I created a simple dashboard, no template variables, no complex queries. While logged in, the dashboard works as expected.

  2. I made the dashboard public using the functionality described here: https://grafana.com/docs/grafana/latest/dashboards/dashboard-public/

  3. When loading the dashboard, all 3 requests to the data source fail. The developer console shows "500 internal server error"s.

  4. the server logs have some more info:


logger=publicdashboards.service t=2023-10-17T11:08:39.17688086Z level=error msg="Error querying datasources for public dashboard" error="data source not found" datasources=[influxdb]

logger=context userId=1 orgId=1 uname=admin t=2023-10-17T11:08:39.17693254Z level=error msg= error="unexpected error type [*errors.errorString]: data source not found" remote_addr=213.182.3.4 traceID=

logger=context userId=1 orgId=1 uname=admin t=2023-10-17T11:08:39.17697267Z level=error msg="Request Completed" method=POST path=/api/public/dashboards/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/panels/2/query status=500 remote_addr=xxx.xxx.xxx.xxx time_ms=1 duration=1.949332ms size=48 referer=https://fuerstenschulepublic.cs.egrid.de/public-dashboards/7b648abef11d43b9974baf863a772c06?orgId=1&refresh=10s

As of now, I have no idea where to further debug this problem. Do you have any ideas what the issue could be?

Thanks & best regards

Philipp

Upvotes: 1

Views: 1982

Answers (3)

Santiago Palladino
Santiago Palladino

Reputation: 3542

I just hit this same error. It was caused by the datasource uids having the wrong case. It seemed like the datasource uid is case insensitive for private, but sensitive for public.

Upvotes: 0

TimoFran
TimoFran

Reputation: 117

If you copy-pasted from another Grafana Server the problem could be the id of the datasource. This is the part of json causing the issue:

"datasource": {
    "type": "influxdb",
    "uid": "xxxxxxxxxxxxxx"
}

How to solve:

  1. Create a new empty dashboard and select the correct data source
  2. Create an empty visualization
  3. Open the JSON of the new dashboard and copy the datasource uid
  4. Paste the new uid everywhere inside the json of the real dashboard

Upvotes: 1

PhilippG
PhilippG

Reputation: 81

I found the source of the problem: I copy pasted the Dashboard definition from another Grafana Instance. I re-created the Dashboard on the new Instance and it works :) I did not check yet which part of the dashboard JSON causes the issue. If I find it, I will post it here. –

Upvotes: 0

Related Questions