Unable to upload revision of dashboard

I’m “suddenly” unable to upload a revision of a dashboard at , and get an error

Error: Field is required: version

The web page has always been a bit flaky in remembering who I am, and it often takes a few attempts before you can from “My Dashboards” through “Details” and be able to upload a revision (there’s a redirect flashing in the browser) but once it shows me the “Edit ->” tab, it recognized that I’m the owner of the dashboard, I think. Chrome DevTools suggests a 409 status from app.js

There is a version in that JSON file, and it’s straight from the Grafana “export” function.

The export and import functions don’t seem to agree, but there’s an easy workaround:

First of all, remember to download with external sharing

Look at the top of the file - it’s something like this:

{
  "__inputs": [
    {
      "name": "DS_GRAFANACLOUD-GREGORZEITLINGER-PROM",
      "label": "grafanacloud-gregorzeitlinger-prom",
      "description": "",
      "type": "datasource",
      "pluginId": "prometheus",
      "pluginName": "Prometheus"
    }
  ],
  "__elements": {},
  "__requires": [
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "10.3.0-63970"
    },
    {
      "type": "panel",
      "id": "graph",
      "name": "Graph (old)",
      "version": ""
    },
    {
      "type": "datasource",
      "id": "prometheus",
      "name": "Prometheus",
      "version": "1.0.0"
    },
    {
      "type": "panel",
      "id": "stat",
      "name": "Stat",
      "version": ""
    }
  ],

Now remove all elements where the version is empty graph and stat in this case.
Then upload the file.

3 Likes

Thank you, so it’s that version. I manually removed them, and was able to publish the dashboard. When I imported it from there, and exported, those empty ones have been added again. I guess I need to use some filtering with “jq” to get those out.

Working now but should be fixed by grafana , (to put version number of plugin when export , or to avoid this when import)

Thanks

True. The “import” of Grafana 9.5.1 has no problems with those entries, so it sounds like the screening of the JSON files on the web site was changed. Interesting is that it reports the JSON as “valid” when you upload it, so we seem to have some discrepancy there.
Since those are built-in panel types, I can see it does not create additional requirements. The export should skip those or the website screening short ignore them, like import does.

In case you needed this too, I will pre-process the JSON with
jq 'del(.__requires[] | select(.version == ""))'

1 Like