Chart will not be created and got WARN

Hi everyone here

I’m quite frustrated. I tried to setup rrd4j persistence and store the temperature data of one item. But for some reason I can not get any Grafik in my sitemap.

I use Raspberry Pi 3 as my server.

I have set the log unter DEBUG and I can see the Temperature will be written in the the Database. I can find the database under
“var/lib/openhab2/persistence/rrd4j”.

When I deleted the Database, it will be crated again wenn the temperature update again.

So I think the configuration for and Setting for the database should be O.K.

The WARN is: Chart generation failed: null

so the whole DEBUG is:

00:40:47.291 [DEBUG] [rthome.ui.internal.chart.ChartServlet] - Received incoming chart request: Request(GET //192.168.178.40:8080/chart?items=F2_Bathroom_Temperature&period=h&random=100&service=rrd4j)@4b5341
00:40:47.343 [DEBUG] [rthome.ui.internal.chart.ChartServlet] - No begin or end is specified, use now as end and now-period as begin.
00:40:47.379 [DEBUG] [rthome.ui.internal.chart.ChartServlet] - chart building with width 480 height 240 dpi null
00:40:47.397 [DEBUG] [ultchartprovider.DefaultChartProvider] - Rendering chart: service: 'rrd4j', theme: 'null', startTime: 'Sun Oct 21 23:40:47 CEST 2018', endTime: 'Mon Oct 22 00:40:47 CEST 2018', width: '480', height: '240', items: 'F2_Bathroom_Temperature', groups: 'null', dpi: 'null', legend: 'null'
00:40:47.461 [WARN ] [rthome.ui.internal.chart.ChartServlet] - Chart generation failed: null
java.lang.NullPointerException: null
	at sun.awt.FontConfiguration.getVersion(FontConfiguration.java:1264) [?:?]
	at sun.awt.FontConfiguration.readFontConfigFile(FontConfiguration.java:219) [?:?]
	at sun.awt.FontConfiguration.init(FontConfiguration.java:107) [?:?]
	at sun.awt.X11FontManager.createFontConfiguration(X11FontManager.java:774) [?:?]
	at sun.font.SunFontManager$2.run(SunFontManager.java:431) [?:?]
	at java.security.AccessController.doPrivileged(Native Method) ~[?:?]
	at sun.font.SunFontManager.<init>(SunFontManager.java:376) [?:?]
	at sun.awt.FcFontManager.<init>(FcFontManager.java:35) [?:?]
	at sun.awt.X11FontManager.<init>(X11FontManager.java:57) [?:?]
	at sun.reflect.GeneratedConstructorAccessor227.newInstance(Unknown Source) [?:?]
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [?:?]
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423) [?:?]
	at java.lang.Class.newInstance(Class.java:442) [?:?]
	at sun.font.FontManagerFactory$1.run(FontManagerFactory.java:83) [?:?]
	at java.security.AccessController.doPrivileged(Native Method) ~[?:?]
	at sun.font.FontManagerFactory.getInstance(FontManagerFactory.java:74) [?:?]
	at java.awt.Font.getFont2D(Font.java:491) [?:?]
	at java.awt.Font.defaultLineMetrics(Font.java:2176) [?:?]
	at java.awt.Font.getLineMetrics(Font.java:2283) [?:?]
	at java.awt.font.TextLayout.fastInit(TextLayout.java:598) [?:?]
	at java.awt.font.TextLayout.<init>(TextLayout.java:393) [?:?]
	at org.knowm.xchart.internal.chartpart.AxisTickCalculator.willLabelsFitInTickSpaceHint(AxisTickCalculator.java:148) [147:org.eclipse.smarthome.ui:0.10.0.oh230]
	at org.knowm.xchart.internal.chartpart.AxisTickDateCalculator.calculate(AxisTickDateCalculator.java:214) [147:org.eclipse.smarthome.ui:0.10.0.oh230]
	at org.knowm.xchart.internal.chartpart.AxisTickDateCalculator.<init>(AxisTickDateCalculator.java:115) [147:org.eclipse.smarthome.ui:0.10.0.oh230]
	at org.knowm.xchart.internal.chartpart.Axis.getAxisTickCalculator(Axis.java:363) [147:org.eclipse.smarthome.ui:0.10.0.oh230]
	at org.knowm.xchart.internal.chartpart.Axis.getXAxisHeightHint(Axis.java:286) [147:org.eclipse.smarthome.ui:0.10.0.oh230]
	at org.knowm.xchart.internal.chartpart.Axis.paint(Axis.java:180) [147:org.eclipse.smarthome.ui:0.10.0.oh230]
	at org.knowm.xchart.internal.chartpart.AxisPair.paint(AxisPair.java:147) [147:org.eclipse.smarthome.ui:0.10.0.oh230]
	at org.knowm.xchart.internal.chartpart.ChartPainter.paint(ChartPainter.java:114) [147:org.eclipse.smarthome.ui:0.10.0.oh230]
	at org.knowm.xchart.Chart.paint(Chart.java:102) [147:org.eclipse.smarthome.ui:0.10.0.oh230]
	at org.eclipse.smarthome.ui.internal.chart.defaultchartprovider.DefaultChartProvider.createChart(DefaultChartProvider.java:300) [147:org.eclipse.smarthome.ui:0.10.0.oh230]
	at org.eclipse.smarthome.ui.internal.chart.ChartServlet.doGet(ChartServlet.java:316) [147:org.eclipse.smarthome.ui:0.10.0.oh230]
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:687) [31:javax.servlet-api:3.1.0]
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) [31:javax.servlet-api:3.1.0]
	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:848) [85:org.eclipse.jetty.servlet:9.3.21.v20170918]
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:584) [85:org.eclipse.jetty.servlet:9.3.21.v20170918]
	at org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:71) [183:org.ops4j.pax.web.pax-web-jetty:6.0.9]
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) [84:org.eclipse.jetty.server:9.3.21.v20170918]
	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548) [82:org.eclipse.jetty.security:9.3.21.v20170918]
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226) [84:org.eclipse.jetty.server:9.3.21.v20170918]
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1180) [84:org.eclipse.jetty.server:9.3.21.v20170918]
	at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:284) [183:org.ops4j.pax.web.pax-web-jetty:6.0.9]
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:512) [85:org.eclipse.jetty.servlet:9.3.21.v20170918]
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185) [84:org.eclipse.jetty.server:9.3.21.v20170918]
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1112) [84:org.eclipse.jetty.server:9.3.21.v20170918]
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) [84:org.eclipse.jetty.server:9.3.21.v20170918]
	at org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:80) [183:org.ops4j.pax.web.pax-web-jetty:6.0.9]
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134) [84:org.eclipse.jetty.server:9.3.21.v20170918]
	at org.eclipse.jetty.server.Server.handle(Server.java:534) [84:org.eclipse.jetty.server:9.3.21.v20170918]
	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:333) [84:org.eclipse.jetty.server:9.3.21.v20170918]
	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:251) [84:org.eclipse.jetty.server:9.3.21.v20170918]
	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:283) [76:org.eclipse.jetty.io:9.3.21.v20170918]
	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:108) [76:org.eclipse.jetty.io:9.3.21.v20170918]
	at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93) [76:org.eclipse.jetty.io:9.3.21.v20170918]
	at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303) [87:org.eclipse.jetty.util:9.3.21.v20170918]
	at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148) [87:org.eclipse.jetty.util:9.3.21.v20170918]
	at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136) [87:org.eclipse.jetty.util:9.3.21.v20170918]
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671) [87:org.eclipse.jetty.util:9.3.21.v20170918]
	at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589) [87:org.eclipse.jetty.util:9.3.21.v20170918]
	at java.lang.Thread.run(Thread.java:748) [?:?]

Thanks very much when someone can help me. I don’t have ideas anymore.

Show the Chart line on your sitemap.

sitemap test label="Test" {
    Frame{
        Switch item=Chart_Temperatur mappings=[0="Hour", 1="Day", 2="Week"]
        Chart item=F2_Bathroom_Temperature period=h refresh=60 visibility=[Chart_Temperatur==0, Chart_Temperatur=="Uninitialized"] legend=true
     }
}

I have deleted the site when Chart_Temperature == 1 and 2. Because I want to the the code easy to analyse.

Have you configured rrd4j as the default persistence? If not you need to supply the persistence engine to use to generate the cart.

service sets the persistence service to use. If no service is specified, openHAB will use the first queryable persistence service it finds. Therefore, for an installation with only a single persistence service, this is not required.

So add service=rrd4j as a parameter to the Chart.

Hi Rich, thanks for your answers. I have also tried with the parameters. But it has no effect. :frowning:

Hello Rich,

I have tried to access the Chat with:

http://192.168.178.40:8080/rrdchart.png?items=F2_Bathroom_Temperature&period=h

and I got the Error in the my explorer.

HTTP ERROR 500

Problem accessing /rrdchart.png. Reason:

    Server Error
Caused by:

java.lang.ExceptionInInitializerError
	at org.rrd4j.graph.RrdGraphDef.<init>(Unknown Source)
	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:848)
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:584)
	at org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:71)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226)
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1180)
	at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:284)
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:512)
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1112)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
	at org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:80)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)
	at org.eclipse.jetty.server.Server.handle(Server.java:534)
	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:333)
	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:251)
	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:283)
	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:108)
	at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93)
	at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303)
	at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148)
	at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136)
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589)
	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(Unknown Source)
	at org.rrd4j.graph.RrdGraphConstants.<clinit>(Unknown Source)
	... 29 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)
	... 31 more

it tells clearly, that I have problem with the font.

And the DEBUG tells us also this information:

at java.awt.font.TextLayout.<init>(TextLayout.java:393) **[?:?]**

Wenn I could fix this issue, I should see the chart. :thinking:

I will try to find the solution.

BR

Can you test if installing the fontconfig package fixes the issue?

sudo apt install fontconfig

1 Like

Hi Wouter,

perfect! Now I can see the Grafik!!

10000x thanks!

BR

1 Like

Since I had the same problem and this was the first (close) solution I found, the full list of required packaces (as in issue 92 for openhabian) is:

sudo apt install libfontconfig1 fontconfig ttf-dejavu
1 Like