[SOLVED] [rrd4j] Chart is not working

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.

It is working now. As I expected the Grafana Package was missing.

Solution was:

SSH in Openhab

sudo openhabian-config

Go to “20 Optional Components” > “24 InfluxDB+Grafana” <>

After installation and reboot it is working now :slight_smile:

1 Like

Ups! Why would/ should packages needed for not used components solve the problem with charts? I have no clue!

I have no idea but it is working :star_struck:

I also can confirm this behaviour

Great work P4trick!
Worked for me too!

Unbeliveable… Same for me, had the same issue and this worked. Thank you!

@maisen20, @crutjohan, @J35u5fr34k, @P4trick
Could you please post what kind of openhabian installation you have (stable, Milestone, snapshot all with the respective version #) .
I’m on a openhabian version running the stable 2.4 release and had no issue with the charts nor with rrd4j!

My openhabian installation:
openHAB 2.5.0 Build #1572

Sorry for reviving this old thread, but I just stumbled upon the same issue and managed to solve it without installing Grafana. As I came up at this thread, I want to share my solution for future users experiencing the same problem.

The problem is simply a missing font package. Simply installing

sudo apt install libfontconfig1

did it for me. After a restart of the openhab2 service the graphs are now working for me.

Greetings, Level147

4 Likes

Thanks to you. I had exactly the same problem and it is now working again.
Just for your information.
I got the following error message after the installation. But after the reboot went everything fine.

[ERROR] [nternal.extensions.ExtensionResource] - Exception while installing extension: No extension service registered for influxdb

For me it was another reason that the charts weren’t working: I have two persistence services (rrd4j and mongodb) running. In this case, I ran into an error “persistence unqueryable”. To fix this, set a default persistence service in the Openhab UI, “Settings > Persistence > RRD4j”.