[SOLVED] [rrd4j] Chart is not working

Greatings,

I am new to OH2 and I could work out most issue by my own but now I run into an issue with RRD4J which is not showing the chart. There is now picture showing up.

I am running
OH2 2.4.0-1
Java 8

openjdk version “1.8.0_202”
OpenJDK Runtime Environment (Zulu8.36.0.152-CA-linux_aarch32hf) (build 1.8.0_202 -b152)
OpenJDK Client VM (Zulu8.36.0.152-CA-linux_aarch32hf) (build 25.202-b152, mixed mode, Evaluation)

Item file includes

Group Wohnzimmer

Number:Temperatur Wohnzimmer_Solltemperatur "Solltemperatur [%.1f °C]" <Temperatur> (Wohnzimmer) {channel="avmfritz:Comet_DECT:192_xxx_xxx_xxx:xxxx:set_temp"}

Number:Temperatur Wohnzimmer_Temperatur "Temperatur" <Temperatur> (Wohnzimmer) {channel="avmfritz:Comet_DECT:192_xxx_xxx_xxx:xxx:temperature"}

String Wohnzimmer_CometMode "Heizungsmodus [%s]" (Wohnzimmer) { channel="avmfritz:Comet_DECT:192_xxx_xxx_xxx:xxx:radiator_mode" }

Sitemap code is

Frame label="Temp. Innen/Außen"	{
	Chart item=Wohnzimmer_Temperatur period=h refresh=7200
	}

rrd4j.persist includes code

Strategies {
   everyMinute	: "0 * * * * ?"
   everyHour    : "0 0 * * * ?"
   everyDay     : "0 0 0 * * ?"
   default = everyChange
}
 
 
Items {
        //Innentemperatur
        Wohnzimmer_Temperatur : strategy = everyMinute, restoreOnStartup
    }

I get following failure message in the log file

2019-04-13 09:18:06.164 [WARN ] [thome.ui.internal.chart.ChartServlet] - Chart generation failed: null

Any first aid? Thank you in advance!

Welcome!

You need to either set rrd4j as the default persistence on PaperUI ( under Config-System-Persistence) or set the desired persistence in the Chart line ( service=rrd4j ).

Hi opus, thank you for your quick reply. I did both, but chart is not showing up.
What need to be installed to show charts in general?

rrd4j for sure but anything else?

I restarted several times, but no chart :frowning:

Are you sure that the item-definition is ok and has a value? Should it not be:

Number:Temperature Wohnzimmer_Temperatur “Temperatur” (Wohnzimmer) {channel=“avmfritz:Comet_DECT:192_xxx_xxx_xxx:xxx:temperature”}

Thanks michaeljoos, I changed the it and restarted my Pi. No result.

So I deleted the .rrd file. No results

I checked my services folder. There is no charts.cfg file. Is it necessary? I have done configuration in Paper UI.

I had issues at first installation in Paper UI, it looked like Addon was not installed probably so I SSH now in Pi and tried installation manually but I get following response:


[11:15:42] xxx@openHABianPi:~$ sudo apt-get  install openhab-addon-persistence-rrd4j
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package openhab-addon-persistence-rrd4j

I’m not sure why you would need to install something manually on an openhabian system.
Could you check on the Dashboard if you see the “REST API”. If yes, open it and select the first blue GET under persistence. On that page hit “Try it out”.
You should get an output of:

  {
    "id": "rrd4j",
    "label": "rrd4j",
    "type": "Queryable"
  }
]

If you have that, we will digg deeper.

I wanted to see what happens if I SSH it manually, but unfortunately its not delivering any results :frowning:

Well, if you mean the Dashboard that appears by typing in 192.xxx.xxx.xxx:8080 I do not have a REST API showing up

Correct, I meant this Dashboard. You can install it via PaperUI as an Addon under Misc named “REST Documentation”. Using this UI you could look directly into your database and see if values are stored or not.

So far I am assuming you do see values for the item “Wohnzimmer_Temperatur” on your sitemap and/or on PaperUI under Control.

What exactly did you try?
SSH onto the raspi and then?

Yes “Wohnzimmer_Temperatur” is delivering results.

I have installed the binding REST Documentation and followed your instructions:

#### Curl

curl -X GET --header "Accept: application/json" "http://192.xxx.xxx.xxx:8080/rest/persistence"

#### Request URL

http://192.xxx.xxx.xxx:8080/rest/persistence

#### Response Body

[
{
“id”: “rrd4j”,
“label”: “rrd4j”,
“type”: “Queryable”
}
]


#### Response Code

200

#### Response Headers

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

So openHAB “knows” rrd4j, lets see if there is something in the database
Use the 3rd blue “GET” under persistence named " /persistence/items/{itemname}" and set:
serviceID = rrd4j
itemname= Wohnzimmer_Temperatur

and hit “Try it out!”

A valid response with entries would look like.

{
  "name": "E10_1",
  "datapoints": "1440",
  "data": [
    {
      "time": 1555069020000,
      "state": "1.399"
    },
    {
      "time": 1555069080000,
      "state": "1.399"
    },.......

Looks fine for me

#### Curl

curl -X GET --header "Accept: application/json" "http://192.xxx.xxx.xxx:8080/rest/persistence/items/Wohnzimmer_Temperatur?serviceId=rrd4j"

#### Request URL

http://192.xxx.xxx.xxx:8080/rest/persistence/items/Wohnzimmer_Temperatur?serviceId=rrd4j

#### Response Body

{
“name”: “Wohnzimmer_Temperatur”,
“datapoints”: “39”,
“data”: [
{
“time”: 1555146480000,
“state”: “24.5”
},
{
“time”: 1555146720000,
“state”: “24.5”
},
{
“time”: 1555146960000,
“state”: “24.5”
},
{
“time”: 1555147200000,
“state”: “24.5”
},
{
“time”: 1555147440000,
“state”: “24.5”
},
{
“time”: 1555147680000,
“state”: “24.5”
},
{
“time”: 1555147920000,
“state”: “24.5”
},
{
“time”: 1555148160000,
“state”: “24.5”
},
{
“time”: 1555148400000,
“state”: “24.5”
},
{
“time”: 1555148640000,
“state”: “24.5”
},
{
“time”: 1555148880000,
“state”: “24.5”
},
{
“time”: 1555149120000,
“state”: “24.5”
},
{
“time”: 1555149360000,
“state”: “24.5”
},
{
“time”: 1555149600000,
“state”: “24.5”
},
{
“time”: 1555149840000,
“state”: “24.5”
},
{
“time”: 1555150080000,
“state”: “24.5”
},
{
“time”: 1555150320000,
“state”: “24.5”
},
{
“time”: 1555150560000,
“state”: “24.5”
},
{
“time”: 1555150800000,
“state”: “24.5”
},
{
“time”: 1555151040000,
“state”: “24.5”
},
{
“time”: 1555151280000,
“state”: “24.5”
},
{
“time”: 1555151520000,
“state”: “24.5”
},
{
“time”: 1555151760000,
“state”: “24.5”
},
{
“time”: 1555152000000,
“state”: “24.5”
},
{
“time”: 1555152240000,
“state”: “24.5”
},
{
“time”: 1555152480000,
“state”: “24.5”
},
{
“time”: 1555152720000,
“state”: “24.5”
},
{
“time”: 1555152960000,
“state”: “24.5”
},
{
“time”: 1555153200000,
“state”: “24.5”
},
{
“time”: 1555153440000,
“state”: “24.375”
},
{
“time”: 1555153680000,
“state”: “24.0”
},
{
“time”: 1555153920000,
“state”: “24.0”
},
{
“time”: 1555154160000,
“state”: “24.0”
},
{
“time”: 1555154400000,
“state”: “24.0”
},
{
“time”: 1555154640000,
“state”: “24.0”
},
{
“time”: 1555154880000,
“state”: “24.0”
},
{
“time”: 1555155120000,
“state”: “24.0”
},
{
“time”: 1555155360000,
“state”: “23.625”
},
{
“time”: 1555155600000,
“state”: “23.5”
}
]
}


#### Response Code

200

#### Response Headers

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

So you do have entries in the database.
The issue about the missing “e” for “Number:Temperature” is not YOUR Chart problem.

You see 39 entries into the Archive 2 of the database, this archive has a value for every 4 minutes (240000 difference for each time). You do not see the Archive 1 (which would have a value for each minute since the REST call didn’t specify a time and used the default 24 houres, Archive 1 however covers only 8 houres).

Other then the very short refresh value you are using (it is in milliseconds, you are asking for an update every 7.2 seconds!) I do not see a problem with your chart-line ATM.
Looking…

Try a direct call to the chart with:

http://192.xxx.xxx.xxx:8080/rrdchart.png?items=Wohnzimmer_Temperatur&period=h

So finally I get an error message

I am not sure if I have 2 Java versions running…

HTTP ERROR 500
Problem accessing /rrdchart.png. Reason:

    Server Error
Caused by:
java.lang.ExceptionInInitializerError
	at org.rrd4j.graph.RrdGraphDef.<init>(RrdGraphDef.java:80)
	at org.openhab.persistence.rrd4j.internal.charts.RRD4jChartServlet.createChart(RRD4jChartServlet.java:257)
	at org.openhab.persistence.rrd4j.internal.charts.RRD4jChartServlet.service(RRD4jChartServlet.java:157)
	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:865)
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:535)
	at org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:71)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:146)
	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:257)
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1595)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255)
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1317)
	at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:293)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:203)
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:473)
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1564)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:201)
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1219)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:144)
	at org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:80)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
	at org.eclipse.jetty.server.Server.handle(Server.java:531)
	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:352)
	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:260)
	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:281)
	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:102)
	at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:118)
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:762)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:680)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.RuntimeException: java.io.IOException: Problem reading font data.
	at org.rrd4j.graph.RrdGraphConstants$FontConstructor.getFont(RrdGraphConstants.java:287)
	at org.rrd4j.graph.RrdGraphConstants.<clinit>(RrdGraphConstants.java:304)
	... 31 more
Caused by: java.io.IOException: Problem reading font data.
	at java.awt.Font.createFont0(Font.java:1000)
	at java.awt.Font.createFont(Font.java:877)
	at org.rrd4j.graph.RrdGraphConstants$FontConstructor.getFont(RrdGraphConstants.java:283)
	... 32 more
Caused by:
java.lang.RuntimeException: java.io.IOException: Problem reading font data.
	at org.rrd4j.graph.RrdGraphConstants$FontConstructor.getFont(RrdGraphConstants.java:287)
	at org.rrd4j.graph.RrdGraphConstants.<clinit>(RrdGraphConstants.java:304)
	at org.rrd4j.graph.RrdGraphDef.<init>(RrdGraphDef.java:80)
	at org.openhab.persistence.rrd4j.internal.charts.RRD4jChartServlet.createChart(RRD4jChartServlet.java:257)
	at org.openhab.persistence.rrd4j.internal.charts.RRD4jChartServlet.service(RRD4jChartServlet.java:157)
	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:865)
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:535)
	at org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:71)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:146)
	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:257)
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1595)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255)
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1317)
	at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:293)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:203)
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:473)
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1564)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:201)
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1219)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:144)
	at org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:80)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
	at org.eclipse.jetty.server.Server.handle(Server.java:531)
	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:352)
	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:260)
	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:281)
	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:102)
	at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:118)
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:762)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:680)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.io.IOException: Problem reading font data.
	at java.awt.Font.createFont0(Font.java:1000)
	at java.awt.Font.createFont(Font.java:877)
	at org.rrd4j.graph.RrdGraphConstants$FontConstructor.getFont(RrdGraphConstants.java:283)
	... 32 more
Caused by:
java.io.IOException: Problem reading font data.
	at java.awt.Font.createFont0(Font.java:1000)
	at java.awt.Font.createFont(Font.java:877)
	at org.rrd4j.graph.RrdGraphConstants$FontConstructor.getFont(RrdGraphConstants.java:283)
	at org.rrd4j.graph.RrdGraphConstants.<clinit>(RrdGraphConstants.java:304)
	at org.rrd4j.graph.RrdGraphDef.<init>(RrdGraphDef.java:80)
	at org.openhab.persistence.rrd4j.internal.charts.RRD4jChartServlet.createChart(RRD4jChartServlet.java:257)
	at org.openhab.persistence.rrd4j.internal.charts.RRD4jChartServlet.service(RRD4jChartServlet.java:157)
	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:865)
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:535)
	at org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:71)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:146)
	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:257)
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1595)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255)
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1317)
	at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:293)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:203)
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:473)
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1564)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:201)
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1219)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:144)
	at org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:80)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
	at org.eclipse.jetty.server.Server.handle(Server.java:531)
	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:352)
	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:260)
	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:281)
	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:102)
	at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:118)
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:762)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:680)
	at java.lang.Thread.run(Thread.java:748)

My java-version output:

openjdk version "1.8.0_152"
OpenJDK Runtime Environment (Zulu Embedded 8.25.0.76-linux-aarch32hf) (build 1.8.0_152-b76)
OpenJDK Client VM (Zulu Embedded 8.25.0.76-linux-aarch32hf) (build 25.152-b76, mixed mode, Evaluation)

which I got during a standard openhabian install. Can’t say if yours is the problem, or if you have 2 versions installed.

Have the same version installed. I will try to find the installation root and look for a second installation path.

Anyhow, do you see anything uncommon?

As said, no issues obvious to me in your openHAB setup. We checked the rrd4j databases gets filled, you do see values for the persisted item on your sitemap, only the chart is not rendered (either on sitemap or directly). I’m sorry but we are reaching the bounds of my knowledge.

OK, thanks so far! I guess it is an Java issue. I might have done something stupid by installing java8 package via SSH. I try to fix it

Java8, yes this might be it.