Error: Invalid interval string after upgrade to v7.0

Issue: Receiving “An unexpected error happened” when loading some dashboards. Once the error has occurred all dashboards that were working now display to same message until a hard reload in he browser is done.

Actual error message:
Error: Invalid interval string, has to be either unit-less or end with one of the following units: “y, M, w, d, h, m, s, ms”

in t
in WithTheme(undefined)
in div
in div
in t
in x
in div
in t
in x
in r
in Unknown
in t
in Unknown
in h
in Unknown
in Unknown
in t
in t
in l

Environment :
Grafana version: 7.0.2
Data source: InfluxDB

Experienced this also. For me, it was caused by having refresh intervals set to “off”.

If you’re comfortable modifying the Grafana database, stop the service and open with an SQLite editor and copy out the JSON from the dashbord table.

In the JSON, locate:

“refresh_intervals”: [“off”]

Replace the “off” with:

“5s”,“10s”,“30s”,“1m”,“5m”,“15m”,“30m”,“1h”,“2h”,“1d”

Copy the JSON back into the dashboards table and start the service.

Take a backup, worked for me and may not work for you.

still having this issue on 8.1.5. Looks like a bug in handling empty interval value.

This results int the following stack trace:

   PanelQueryRunner Error Error: Invalid interval string, has to be either unit-less or end with one of the following units: "y, M, w, d, h, m, s, ms"
at x (app.77c130bd0edeb5f6b6e6.js:6158)
at Module.w (app.77c130bd0edeb5f6b6e6.js:6158)
at U.createQuery (:3000/public/build/prometheusPlugin.77c130bd0edeb5f6b6e6.js:1)
at U.prepareTargets (:3000/public/build/prometheusPlugin.77c130bd0edeb5f6b6e6.js:1)
at U.query (:3000/public/build/prometheusPlugin.77c130bd0edeb5f6b6e6.js:1)
at app.77c130bd0edeb5f6b6e6.js:6060
at x (app.77c130bd0edeb5f6b6e6.js:6060)
at O.run (app.77c130bd0edeb5f6b6e6.js:3156)