Grafana is failing to load dashboards because the underlying data source configuration for the dashboard has become corrupted or is missing, preventing Grafana from querying the metadata it needs to render the dashboard.
Common Causes and Fixes
-
Data Source Name Mismatch: The most frequent culprit is a mismatch between the data source name referenced in the imported/renamed dashboard’s JSON and the actual data source name configured in Grafana.
-
Diagnosis:
- Go to "Configuration" > "Data Sources".
- Note the exact names of your data sources.
- Export the problematic dashboard JSON (click the dashboard settings cog, then "JSON model").
- Search within the JSON for
"datasource": "YourDataSourceName"or"datasource": null(if it’s pointing to "Global"). - Compare this name against your actual data source names.
-
Fix:
- In the dashboard JSON, find all instances of
"datasource": "OldDataSourceName"or"datasource": nulland replace"OldDataSourceName"with the exact name of your intended data source (e.g.,"datasource": "Prometheus"). If the dashboard was intended to use the default "Global" data source, ensure it’s explicitly set to"datasource": "-". - Alternatively, if you are editing a dashboard that is already in Grafana, you can go to the dashboard settings, click on "General," and under "Data source," select the correct data source from the dropdown.
- Save the dashboard.
- In the dashboard JSON, find all instances of
-
Why it works: Grafana uses the
datasourcefield in the dashboard’s JSON model to know which data source to query for panels. If this name is incorrect or points to a non-existent data source, Grafana can’t fetch the panel data, leading to a "Dashboard Not Found" or broken panel error.
-
-
Corrupted Data Source Configuration: The data source itself might be misconfigured or have stale credentials, even if the name matches.
-
Diagnosis:
- Navigate to "Configuration" > "Data Sources".
- Click on the data source that your dashboard is supposed to use.
- Click the "Save & Test" button.
-
Fix:
- If "Save & Test" fails, review the data source settings (URL, authentication, etc.) and correct any errors.
- If it passes, still try re-saving the data source configuration. Sometimes just re-applying the settings clears up internal inconsistencies.
- Ensure the data source is enabled and not paused.
-
Why it works: A broken data source means Grafana cannot communicate with the backend system (like Prometheus, InfluxDB, etc.) to retrieve metrics, making the dashboard panels fail to render.
-
-
UID Collision After Import: If you import a dashboard that has the same UID as an existing dashboard, Grafana might create a duplicate with a slightly modified UID, or the import process might fail silently, leaving the dashboard in an unrenderable state.
-
Diagnosis:
- Go to "Dashboards" > "Browse".
- Look for duplicate dashboard names or dashboards with similar-looking titles.
- Check the URL of the broken dashboard. If it contains a long alphanumeric string (the UID), compare it to the UIDs of other dashboards.
- Manually check the JSON model for the suspected duplicate dashboards to see if their UIDs match.
-
Fix:
- Delete the older or duplicate dashboard that shares the UID.
- Re-import the dashboard. Grafana will assign a new, unique UID.
- Alternatively, if you have administrator access, you can use the Grafana API to manually update the UID of the dashboard.
-
Why it works: Each dashboard in Grafana has a unique identifier (UID). If two dashboards share the same UID, Grafana gets confused about which one to load or update, especially after import operations.
-
-
Permissions Issues: The user trying to view the dashboard or the Grafana service account itself might not have the necessary permissions to access the data source or the dashboard folder.
-
Diagnosis:
- Check the "Permissions" tab for the dashboard folder.
- Check the "Permissions" tab for the specific data source.
- If you are using Grafana Cloud or a multi-tenant setup, ensure the organizational permissions are correct.
- Check Grafana’s server logs (
/var/log/grafana/grafana.logor similar) forpermission deniederrors.
-
Fix:
- Grant the appropriate roles (e.g., "Viewer," "Editor") to the user or team for the dashboard folder.
- Ensure the data source has permissions set for the relevant organization/users.
- If the Grafana service account is restricted, ensure it has read access to the data source.
-
Why it works: Grafana enforces access control. If a user or the system lacks the required permissions, it will prevent access to resources, including dashboards and their underlying data sources.
-
-
Browser Cache or Stale Session: Sometimes, the browser holds onto old information, preventing the new dashboard configuration from loading correctly.
-
Diagnosis:
- Try accessing the dashboard in an incognito/private browsing window.
- Try accessing the dashboard from a different browser.
- Check if other dashboards are loading correctly.
-
Fix:
- Clear your browser’s cache and cookies for the Grafana domain.
- Log out of Grafana and log back in.
- Restart the Grafana server process.
-
Why it works: A corrupted cache or an expired session can lead to Grafana serving outdated or incomplete dashboard metadata to your browser, causing rendering issues.
-
-
Incorrect Dashboard JSON Structure or Missing Fields: The imported JSON might be malformed or missing critical fields required by the Grafana version you are running.
-
Diagnosis:
- Validate the imported JSON against a known good dashboard JSON from your Grafana version.
- Check the Grafana server logs for JSON parsing errors during import or dashboard loading.
-
Fix:
- Manually edit the JSON to correct syntax errors or add missing required fields (e.g.,
uid,version,title,panels). - If the JSON was generated by an external tool, try regenerating it or using a different export source.
- Ensure you are using a JSON schema compatible with your Grafana version.
- Manually edit the JSON to correct syntax errors or add missing required fields (e.g.,
-
Why it works: Grafana expects a specific JSON structure to define dashboards. Any deviation can prevent it from correctly parsing and rendering the dashboard definition.
-
After fixing these issues, the next error you might encounter is a "Data source is not available" error if the data source itself is truly offline or misconfigured at the backend level, even if Grafana can reference it.