Template Service Error when using Discrete Visualization

  • What Grafana version and what operating system are you using?
    v6.7.4 Ubuntu 21.10 on my home PC

  • What are you trying to achieve?
    I would like to view a dashboard that shows discrete (ON/OFF) data from various tables.

  • How are you trying to achieve it?
    OpenHAB stores ON/OFF entries in a table in a MySQL db on my NAS. I query it with grafana, format as Table, and select the “Discrete” visualization.

  • What happened?
    When I first setup the visualization, it generally works as expected. But, if I start changing the time filter to different values, then I get the following error message:

Note that this doesn’t happen ALL the time. About 10% of the time, it works as expected. I have not yet been able to correlate the failure or success with anything else - it appears random to me right now.

  • What did you expect to happen?
    I expect it to show me my data.

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

  • Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.

  • Did you follow any online instructions? If so, what is the URL?
    Just the discrete plugin docs for displaying data.
    Discrete plugin for Grafana | Grafana Labs

nobody knows? Does this only happen to me?

I think most folks have moved away from v6.7.4 hence maybe no one is responding to your question
Is there any reason you cannot upgrade? if not can you post some sample data please?

It is an error in your dashboard variable defitions, not in your panel query.

Yup, it was because my version was old.

I was snap to install grafana, and the latest/stable channel appears stuck at v6.7.4. there is another channel called 20.04/stable which brought me up to 7.2.0 and solved the problem.

There are later versions available in the various pre-release channels on snap, but the snap package is clearly lagging quite a bit behind the versions available for download.

Do you have to use snap?