Migration from 2.5.12 to 3.4.4 manual install (mysensors, ArchlinuxARM, charts,...)

Hi,

after a really long time and mainly an aging SDcard, I managed nearly complete to upgrade my manual install on a Odroid U3 with ArchlinuxARM (Zulu 11.64.19) from 2.5.12 to 3.4.4. Some handwork was required, due to I created a large sitemap by textual input, as well as 70 things and 376 items. After figuring out to use the Mysensors binding 3.3.0 with a serial connection (no mqtt), seems the installation description for mysensor-binding is a bit outdated. After I feature:install “openhab-core-io-transport-serial-javacom”, the mysensors-binding start to work. For some reasons, after a reboot, I need to restart the openhab-service once. A work around yet, but I can deal with that. Similar situation for the Zigbee binding with CC2531EMK. Both bindings are using tty USB ports and working just after OpenHAB restart constant without issues, but not after a complete boot.

Main problem is currently, the charts are all not working! I would appreciate any new hints for a failure investigation… I use rrd4j as persistence service (same for 2.5.12 and 3.4.4) and remove the *.rrd files and get them filled again with values. From openhab.log I got this error:

2023-06-11 13:01:46.755 [WARN ] [org.eclipse.jetty.server.HttpChannel] - /chart
java.lang.InternalError: java.lang.reflect.InvocationTargetException
	at sun.font.FontManagerFactory$1.run(FontManagerFactory.java:86) ~[?:?]
	at java.security.AccessController.doPrivileged(Native Method) ~[?:?]
	at sun.font.FontManagerFactory.getInstance(FontManagerFactory.java:74) ~[?:?]
	at java.awt.Font.getFont2D(Font.java:497) ~[?:?]
	at java.awt.Font.defaultLineMetrics(Font.java:2366) ~[?:?]
	at java.awt.Font.getLineMetrics(Font.java:2473) ~[?:?]
	at java.awt.font.TextLayout.fastInit(TextLayout.java:597) ~[?:?]
	at java.awt.font.TextLayout.<init>(TextLayout.java:392) ~[?:?]
	at org.knowm.xchart.internal.chartpart.AxisTickCalculator_.willLabelsFitInTickSpaceHint(AxisTickCalculator_.java:116) ~[?:?]
	at org.knowm.xchart.internal.chartpart.AxisTickCalculator_Date.calculate(AxisTickCalculator_Date.java:214) ~[?:?]
	at org.knowm.xchart.internal.chartpart.AxisTickCalculator_Date.<init>(AxisTickCalculator_Date.java:115) ~[?:?]
	at org.knowm.xchart.internal.chartpart.Axis.getAxisTickCalculator(Axis.java:335) ~[?:?]
	at org.knowm.xchart.internal.chartpart.Axis.getXAxisHeightHint(Axis.java:253) ~[?:?]
	at org.knowm.xchart.internal.chartpart.Axis.paint(Axis.java:168) ~[?:?]
	at org.knowm.xchart.internal.chartpart.AxisPair.paint(AxisPair.java:57) ~[?:?]
	at org.knowm.xchart.XYChart.paint(XYChart.java:246) ~[?:?]
	at org.knowm.xchart.XYChart.paint(XYChart.java:220) ~[?:?]
	at org.openhab.core.ui.internal.chart.defaultchartprovider.DefaultChartProvider.createChart(DefaultChartProvider.java:291) ~[?:?]
	at org.openhab.core.ui.internal.chart.ChartServlet.doGet(ChartServlet.java:322) ~[?:?]
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:687) ~[bundleFile:3.1.0]
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) ~[bundleFile:3.1.0]
	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:799) ~[?:?]
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:550) ~[?:?]
	at org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:74) ~[?:?]
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) ~[bundleFile:9.4.46.v20220331]
	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:600) ~[?:?]
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127) ~[bundleFile:9.4.46.v20220331]
	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235) ~[bundleFile:9.4.46.v20220331]
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1624) ~[bundleFile:9.4.46.v20220331]
	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233) ~[bundleFile:9.4.46.v20220331]
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1440) ~[bundleFile:9.4.46.v20220331]
	at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:294) ~[?:?]
	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188) ~[bundleFile:9.4.46.v20220331]
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:501) ~[?:?]
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1594) ~[bundleFile:9.4.46.v20220331]
	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186) ~[bundleFile:9.4.46.v20220331]
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1355) ~[bundleFile:9.4.46.v20220331]
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) ~[bundleFile:9.4.46.v20220331]
	at org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:90) ~[?:?]
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127) ~[bundleFile:9.4.46.v20220331]
	at org.eclipse.jetty.server.Server.handle(Server.java:516) ~[bundleFile:9.4.46.v20220331]
	at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:487) ~[bundleFile:9.4.46.v20220331]
	at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:732) ~[bundleFile:9.4.46.v20220331]
	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:479) [bundleFile:9.4.46.v20220331]
	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:277) [bundleFile:9.4.46.v20220331]
	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311) [bundleFile:9.4.46.v20220331]
	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105) [bundleFile:9.4.46.v20220331]
	at org.eclipse.jetty.io.ssl.SslConnection$DecryptedEndPoint.onFillable(SslConnection.java:555) [bundleFile:9.4.46.v20220331]
	at org.eclipse.jetty.io.ssl.SslConnection.onFillable(SslConnection.java:410) [bundleFile:9.4.46.v20220331]
	at org.eclipse.jetty.io.ssl.SslConnection$2.succeeded(SslConnection.java:164) [bundleFile:9.4.46.v20220331]
	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105) [bundleFile:9.4.46.v20220331]
	at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104) [bundleFile:9.4.46.v20220331]
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:338) [bundleFile:9.4.46.v20220331]
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:315) [bundleFile:9.4.46.v20220331]
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:173) [bundleFile:9.4.46.v20220331]
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131) [bundleFile:9.4.46.v20220331]
	at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:409) [bundleFile:9.4.46.v20220331]
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883) [bundleFile:9.4.46.v20220331]
	at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034) [bundleFile:9.4.46.v20220331]
	at java.lang.Thread.run(Thread.java:829) [?:?]
Caused by: java.lang.reflect.InvocationTargetException
	at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:?]
	at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:?]
	at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:?]
	at java.lang.reflect.Constructor.newInstance(Constructor.java:490) ~[?:?]
	at sun.font.FontManagerFactory$1.run(FontManagerFactory.java:84) ~[?:?]
	... 59 more
Caused by: java.lang.NullPointerException
	at sun.awt.FontConfiguration.getVersion(FontConfiguration.java:1264) ~[?:?]
	at sun.awt.FontConfiguration.readFontConfigFile(FontConfiguration.java:225) ~[?:?]
	at sun.awt.FontConfiguration.init(FontConfiguration.java:107) ~[?:?]
	at sun.awt.X11FontManager.createFontConfiguration(X11FontManager.java:719) ~[?:?]
	at sun.font.SunFontManager$2.run(SunFontManager.java:379) ~[?:?]
	at java.security.AccessController.doPrivileged(Native Method) ~[?:?]
	at sun.font.SunFontManager.<init>(SunFontManager.java:324) ~[?:?]
	at sun.awt.FcFontManager.<init>(FcFontManager.java:35) ~[?:?]
	at sun.awt.X11FontManager.<init>(X11FontManager.java:56) ~[?:?]
	at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:?]
	at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:?]
	at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:?]
	at java.lang.reflect.Constructor.newInstance(Constructor.java:490) ~[?:?]
	at sun.font.FontManagerFactory$1.run(FontManagerFactory.java:84) ~[?:?]
	... 59 more
Frame label="MySensors" {
                Text item=nodeWZ_temp {
                    Text item=nodeWZ_temp_Max valuecolor=[>25=orange,>15=green,>5=orange,<=5=blue]
                    Text item=nodeWZ_temp_Min valuecolor=[>25=orange,>15=green,>5=orange,<=5=blue]
                    Text item=nodeWZ_temp_LU valuecolor=[nodeWZ_temp_LU>240=orange,nodeWZ_temp_LU>2400=red] visibility=[nodeWZ_temp_LU>240]
                    Switch item=chart_DWM mappings=[0=Tag,1=Woche,2=Monat,3=Jahr]
                    Chart item=nodeWZ_temp period="D" refresh=1800 visibility=[chart_DWM==0,chart_DWM==Uninitialized]
                    Chart item=nodeWZ_temp period="W" refresh=3600 visibility=[chart_DWM==1]
                    Chart item=nodeWZ_temp period="M" refresh=3600 visibility=[chart_DWM==2]
                    Chart item=nodeWZ_temp period="Y" refresh=3600 visibility=[chart_DWM==3]

Hope anyone can support me with some further ideas… Many thanks in advance!

Florian

For the first problem, how are you installing the add-ons? When you drop an add-on’s jar file into the addons folder, dependencies are not automatically installed. But if you install through the karaf console, REST API, UI, or even using the addons.cfg file then dependencies do get installed. Most of the add-ons that use a serial connect share the same serial-javacom module.

The error is complaining about the Font for some reason. What browser are you using?

Do you get the same error in other browsers?

Does the error occur when the .sitemap file is loaded or when you try to view it in a client/browser?

Hi Rich,

many thanks for your response. For 2.5.12 I use the textual config files only, since I switch to 3.4.4, I install all add-ons by the UI, with the exception of the mysensors-binding. The mysensors-binding I add to the /opt/openhab/addons folder. The required features I install by ssh localhost:8101. The mysensors-binding get no official support.

The chart error occur, if I visit/show the sitemap by browser, but doesn’t matter which browser. Tested with Firefox (Linux/Windows), Edge (Windows), Vivaldi (Linux). Also the Android app is not showing the charts. I add my 2.5.12 used sitemap configuration file, removing the comment lines (seems, they are not supported in the UI browser file editor). The UI editor (https://xxx.xxx.xxx.xxx:8443/settings/pages/sitemap/page_xxxxxx) show my code as valid and I could store it. Beside the charts, everything is working smooth.

If there seems fonts missing, per your feedback, is there any fonts required from base system? I can’t remember to install any font separate on my <=2.5.12 install back in 2018…

Florian

No, there should be nothing you need to install and configure for the fonts. That’s why I asked which browser you are using to show the sitemap. I was hoping it was something weird there.

I’ve no ideas why this error would happen.

The best I can recommend at this point is to see if you can try it in the latest milestone release of OH 4 and if the error persists file an issue.

Hi Rich,

I’m searching a bit regarding the fonts issues. There was old topics in Github for a similar issue upgrading to OpenHAB 2.5. On some Linux systems the package “fontconfig” is required. It was missing in my installation, but also after installation and clearing userdata/cache & userdata/tmp still I have the same issue. Also replaced the zulu jre 11 with the distribution openjdk jre 11, clearing cache and tmp again, but still no change with not showing the charts.

I don’t have any installation to compare, but should in in the openhab.log field ~[?:?] from the error message normally the java version shown?

Florian

No, it doesn’t usually mention anything about the Java version. However, in OH 3 if you go to MainUI → Help and About → Technical Information it will show the Java version there.

Hi Rick,

figured out and solved! Seems OpenHAB is expecting a physical font for generating the charts. So beside the “fontconfig” package I installed “ttf-dejavu” and all charts are working again. Never expected… Just the minor topic regarding the serial binding connections with the full boot remain, but as workaround a restart of OpenHAB service once work. Maybe a timing issue…

Florian

1 Like