[SOLVED] Problem: Chart generation failed: null

That’s it. Find persistence. click Show. click GET … {itemname). fill in the item name box. press Try it Out button.

First Thank you for your responds
I did the instructions you showed me but it doesn’t work yet please chech the code:

1- Curl :

curl -X GET --header "Accept: application/json" "http://192.168.2.169:8080/rest/persistence/items/home_temp"

2- Request URL :

http://192.168.2.169:8080/rest/persistence/items/home_temp

3- Response Body:

{
  "name": "home_temp",
  "datapoints": "68",
  "data": [
    {
      "time": 1559009760000,
      "state": "28.300000000000008"
    },
    {
      "time": 1559010600000,
      "state": "28.300000000000008"
    },
    {
      "time": 1559011440000,
      "state": "28.300000000000008"
    },
    {
      "time": 1559012280000,
      "state": "28.300000000000008"
    },
    {
      "time": 1559013120000,
      "state": "28.300000000000008"
    },
    {
      "time": 1559013960000,
      "state": "28.300000000000008"
    },
    {
      "time": 1559014800000,
      "state": "28.300000000000008"
    },
    {
      "time": 1559015640000,
      "state": "28.300000000000008"
    },
    {
      "time": 1559016480000,
      "state": "30.45"
    },
    {
      "time": 1559017320000,
      "state": "31.77857142857142"
    },
    {
      "time": 1559018160000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559019000000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559019840000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559020680000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559021520000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559022360000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559023200000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559024040000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559024880000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559025720000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559026560000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559027400000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559028240000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559029080000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559029920000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559030760000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559061000000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559061840000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559062680000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559063520000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559064360000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559065200000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559066040000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559066880000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559067720000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559068560000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559069400000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559070240000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559071080000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559071920000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559072760000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559073600000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559074440000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559075280000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559076120000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559076960000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559077800000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559078640000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559079480000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559080320000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559081160000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559082000000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559082840000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559083680000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559084520000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559085360000,
      "state": "31.699999999999992"
    },
    {
      "time": 1559086200000,
      "state": "26.97142857142857"
    },
    {
      "time": 1559087040000,
      "state": "27.100000000000005"
    },
    {
      "time": 1559087880000,
      "state": "27.100000000000005"
    },
    {
      "time": 1559088720000,
      "state": "27.100000000000005"
    },
    {
      "time": 1559089560000,
      "state": "27.100000000000005"
    },
    {
      "time": 1559090400000,
      "state": "27.100000000000005"
    },
    {
      "time": 1559091240000,
      "state": "27.100000000000005"
    },
    {
      "time": 1559092080000,
      "state": "27.100000000000005"
    },
    {
      "time": 1559092920000,
      "state": "27.100000000000005"
    },
    {
      "time": 1559093760000,
      "state": "27.100000000000005"
    },
    {
      "time": 1559094600000,
      "state": "27.100000000000005"
    },
    {
      "time": 1559095440000,
      "state": "27.100000000000005"
    }
  ]
}

4- Response Code :

200

5- Response Headers :

{
  "content-length": "3568",
  "server": "Jetty(9.4.11.v20180605)",
  "content-type": "application/json"
}

This was about making sure that you have good persisted data, which you need for charts.
Because rrd4j does some merging of older data, you’d only expect to see the last day or so of data this way.

The data that you got is all from the month of May 2019.
There won’t be any data for the hourly chart you requested.
You might get a chart for a yearly period?

But I think you broke your rrd4j persistence back in May.
If I were you, I would get rid of your strange rrd4j.cfg and try instead with the default version, get charts working before messing around with that.

I do not know where I start, please can you help me to use your proposal? (I would get rid of your strange rrd4j.cfg and try instead with the default version)

Here’s my services/rrd4j.cfg, left as default. It’s basically empty, just comments

# configure specific rrd properties for given items in this file.
# please refer to the documentation available at
# https://www.openhab.org/addons/persistence/rrd4j/
#
# default_numeric and default_other are internally defined defnames and are used as
# defaults when no other defname applies
#<defname>.def=[ABSOLUTE|COUNTER|DERIVE|GAUGE],<heartbeat>,[<min>|U],[<max>|U],<step>
#<defname>.archives=[AVERAGE|MIN|MAX|LAST|FIRST|TOTAL],<xff>,<steps>,<rows>
#<defname>.items=<comma separated list of items for this defname>

Stop and restart openHAB after any changes here.

I addition to the suggestions of @rossko57 I’d remove the broken .rrd file, which might prevent the creation of a new one.
If you really need a custom setup of the rrd4j-archives either look into the documentation or ask a new question, I’d be happy to help.
But for starting go with the default setup.

I try but it’s not working :frowning:

Cool. What is not working?

I’d guess the existing .rrd is preventing to create a new one. Looking at the REST output we see timesteps between readings of 840 seconds, such do NOT belong to any archive of the used .cfg (which is the same as the default archive setup).

that :

Okay. Then you’ll have to work through it again, because we cannot see what is happening and you have to tell us.

Use the REST API to find out if you are now storing recent persistence data.

you mean that :
/var/lib/openhab2/persistence/rrd4j:

home_temp.rrd file:

Please ,how can you see the date (time)?
Curl

curl -X GET --header "Accept: application/json" "http://192.168.2.169:8080/rest/persistence/items/home_temp"

Request URL

http://192.168.2.169:8080/rest/persistence/items/home_temp

Response Body

{
  "name": "home_temp",
  "datapoints": "12",
  "data": [
    {
      "time": 1563112800000,
      "state": "25.4"
    },
    {
      "time": 1563113040000,
      "state": "25.4"
    },
    {
      "time": 1563113280000,
      "state": "25.4"
    },
    {
      "time": 1563113520000,
      "state": "25.4"
    },
    {
      "time": 1563113760000,
      "state": "25.4"
    },
    {
      "time": 1563114000000,
      "state": "25.4"
    },
    {
      "time": 1563114240000,
      "state": "25.4"
    },
    {
      "time": 1563114480000,
      "state": "25.4"
    },
    {
      "time": 1563114720000,
      "state": "25.4"
    },
    {
      "time": 1563114960000,
      "state": "25.124999999999996"
    },
    {
      "time": 1563115200000,
      "state": "24.3"
    },
    {
      "time": 1563115440000,
      "state": "24.3"
    }
  ]
}

Response Code

200

Response Headers

{
  "content-length": "517",
  "server": "Jetty(9.4.11.v20180605)",
  "content-type": "application/json"
}

Ups, I have to take that back a bit. The timestamps are 840 seconds, but that is the setting of the archive no. 3 (14 minutes).

Yes, remove this file and start again. The .rrd file can NOT be looked at usefully using an text editor!
Using the REST API you can look at the contents!

i try it :
Response Body

{
  "name": "home_temp",
  "datapoints": "1",
  "data": [
    {
      "time": 1563118320000,
      "state": "24.3"
    }
  ]
}

OK now you have started a new .rrd file (yes, it it was new one in your last post, I missed that, sorry)
It migth take a while until you see a line on the graph since it takes at least two values to make a line!
On your sitemap file, please increase the refresh value, it is supposed to be in milliseconds!
I’m using it like:

Chart item=home_temp period=D legend=true refresh=300000

This bit by the way, is a Unix style “epoch” timestamp.
You can google “epoch convert” for online converters and paste the long number in.

1 Like

I have 5 values but the same problem
Response Body

{
  "name": "home_temp",
  "datapoints": "5",
  "data": [
    {
      "time": 1563118320000,
      "state": "24.3"
    },
    {
      "time": 1563118560000,
      "state": "24.3"
    },
    {
      "time": 1563118800000,
      "state": "25.125"
    },
    {
      "time": 1563119040000,
      "state": "24.849999999999998"
    },
    {
      "time": 1563119280000,
      "state": "27.113333333333333"
    }
  ]
}