Upgraded docker openhab/openhab:2.0.0-amd64 and now fonts error

Tags: #<Tag:0x00007f7452069cd0>

So,
I was running fine with build #703 and the openhab-online docker and decided to update it, bad idea.

Now my sitemaps fail to display any charts.

In the openhab.log I see

2017-02-01 15:01:41.157 [WARN ] [eclipse.jetty.servlet.ServletHandler] - Error for /chart
java.lang.Error: Probable fatal error:No fonts found.
	at sun.font.SunFontManager.getDefaultPhysicalFont(SunFontManager.java:1236)[:1.8.0_112]
	at sun.font.SunFontManager.initialiseDeferredFont(SunFontManager.java:1106)[:1.8.0_112]
	at sun.font.CompositeFont.doDeferredInitialisation(CompositeFont.java:263)[:1.8.0_112]
	at sun.font.CompositeFont.getSlotFont(CompositeFont.java:352)[:1.8.0_112]
	at sun.font.CompositeStrike.getStrikeForSlot(CompositeStrike.java:78)[:1.8.0_112]
	at sun.font.CompositeStrike.getFontMetrics(CompositeStrike.java:93)[:1.8.0_112]
	at sun.font.Font2D.getFontMetrics(Font2D.java:415)[:1.8.0_112]
	at java.awt.Font.defaultLineMetrics(Font.java:2176)[:1.8.0_112]
	at java.awt.Font.getLineMetrics(Font.java:2283)[:1.8.0_112]
	at java.awt.font.TextLayout.fastInit(TextLayout.java:598)[:1.8.0_112]
	at java.awt.font.TextLayout.<init>(TextLayout.java:393)[:1.8.0_112]

and ideas what I need to do, install something ?

So, I backed up my config files and destroyed the whole docker and downloaded the new one.

And it doesnt work, starting from scratch when I try and run it fails:

Launching the openHAB runtime…
karaf: KARAF_ETC is not valid: /openhab/userdata/etc

and that’s it :frowning:

Why is this so hard?..

I just installed OH2 snapshot 2.1.0 docker AMD64, and also experience the same error.

22:10:33.948 [WARN ] [eclipse.jetty.servlet.ServletHandler] - Error for /chart
java.lang.Error: Probable fatal error:No fonts found.
at sun.font.SunFontManager.getDefaultPhysicalFont(SunFontManager.java:1236)[:1.8.0_112]
at sun.font.SunFontManager.initialiseDeferredFont(SunFontManager.java:1106)[:1.8.0_112]
at sun.font.CompositeFont.doDeferredInitialisation(CompositeFont.java:263)[:1.8.0_112]
at sun.font.CompositeFont.getSlotFont(CompositeFont.java:352)[:1.8.0_112]
at sun.font.CompositeStrike.getStrikeForSlot(CompositeStrike.java:78)[:1.8.0_112]
at sun.font.CompositeStrike.getFontMetrics(CompositeStrike.java:93)[:1.8.0_112]
at sun.font.Font2D.getFontMetrics(Font2D.java:415)[:1.8.0_112]
at java.awt.Font.defaultLineMetrics(Font.java:2176)[:1.8.0_112]
at java.awt.Font.getLineMetrics(Font.java:2283)[:1.8.0_112]
at java.awt.font.TextLayout.fastInit(TextLayout.java:598)[:1.8.0_112]
at java.awt.font.TextLayout.(TextLayout.java:393)[:1.8.0_112]
at com.xeiam.xchart.internal.chartpart.Axis.getSizeHint(Axis.java:138)[136:org.eclipse.smarthome.ui:0.9.0.201701192225]
at com.xeiam.xchart.internal.chartpart.Axis.paint(Axis.java:169)[136:org.eclipse.smarthome.ui:0.9.0.201701192225]
at com.xeiam.xchart.internal.chartpart.AxisPair.paint(AxisPair.java:130)[136:org.eclipse.smarthome.ui:0.9.0.201701192225]
at com.xeiam.xchart.internal.chartpart.ChartPainter.paint(ChartPainter.java:94)[136:org.eclipse.smarthome.ui:0.9.0.201701192225]
at com.xeiam.xchart.Chart.paint(Chart.java:105)[136:org.eclipse.smarthome.ui:0.9.0.201701192225]
at org.eclipse.smarthome.ui.internal.chart.DefaultChartProvider.createChart(DefaultChartProvider.java:225)[136:org.eclipse.smarthome.ui:0.9.0.201701192225]
at org.eclipse.smarthome.ui.internal.chart.ChartServlet.doGet(ChartServlet.java:190)[136:org.eclipse.smarthome.ui:0.9.0.201701192225]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)[19:javax.servlet-api:3.1.0]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)[19:javax.servlet-api:3.1.0]
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:812)[81:org.eclipse.jetty.servlet:9.2.19.v20160908]
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:587)[81:org.eclipse.jetty.servlet:9.2.19.v20160908]
at org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:71)[172:org.ops4j.pax.web.pax-web-jetty:4.3.0]
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)[80:org.eclipse.jetty.server:9.2.19.v20160908]
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577)[79:org.eclipse.jetty.security:9.2.19.v20160908]
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)[80:org.eclipse.jetty.server:9.2.19.v20160908]
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)[80:org.eclipse.jetty.server:9.2.19.v20160908]
at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:287)[172:org.ops4j.pax.web.pax-web-jetty:4.3.0]
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)[81:org.eclipse.jetty.servlet:9.2.19.v20160908]
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)[80:org.eclipse.jetty.server:9.2.19.v20160908]
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)[80:org.eclipse.jetty.server:9.2.19.v20160908]
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)[80:org.eclipse.jetty.server:9.2.19.v20160908]
at org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:80)[172:org.ops4j.pax.web.pax-web-jetty:4.3.0]
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)[80:org.eclipse.jetty.server:9.2.19.v20160908]
at org.eclipse.jetty.server.Server.handle(Server.java:499)[80:org.eclipse.jetty.server:9.2.19.v20160908]
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311)[80:org.eclipse.jetty.server:9.2.19.v20160908]
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)[80:org.eclipse.jetty.server:9.2.19.v20160908]
at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:544)[72:org.eclipse.jetty.io:9.2.19.v20160908]
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)[83:org.eclipse.jetty.util:9.2.19.v20160908]
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)[83:org.eclipse.jetty.util:9.2.19.v20160908]
at java.lang.Thread.run(Thread.java:745)[:1.8.0_112]

Glad its not just me.

Seems a basic install of the docker is also broken :frowning:

I’ve tried 2.0.0 and 2.1.0-snapshot and they both fail on a clean install, when trying to run:

Launching the openHAB runtime...
karaf: KARAF_ETC is not valid: /openhab/userdata/etc

When I upgraded to snapshot 2.1.0 using docker (saved my conf and userdata folders), I get the chart error.
When I do a clean install of snapshot 2.1.0 using docker, I don’t get the “KARAF_ETC is not valid” message, just a correct and clean install where I can login in karaf console.

Well, I don’t and looking at the comment here https://hub.docker.com/r/openhab/openhab/ I’m not the only one.

Did you start with empty filesystems for /openhab/conf and /openconf/userdata ? That’s what I’ve tried and it fails.

Permission-issue? I had success following the part “Mounting a host directory as data volume” at https://github.com/openhab/openhab-docker. Had to use the default user with UID 9001, no sucess setting my own UID.

No, it appears you need to copy default config data into the OH folders when using -v option for docker.

Found the fix in yet more different documentation here https://github.com/openhab/openhab-docker

docker run --rm \
  --user 9001
  -v /opt/openhab/addons:/openhab/addons \
  -v /opt/openhab/conf:/openhab/conf \
  -v /opt/openhab/userdata:/openhab/userdata \
  openhab/openhab:2.0.0-amd64 \
  sh -c 'cp -av /openhab/userdata.dist/* /openhab/userdata/ && \
  cp -av /openhab/conf.dist/* /openhab/conf/'

Can anyone help with this chart issue please?

2017-02-02 08:26:43.641 [WARN ] [eclipse.jetty.servlet.ServletHandler] - Error for /chart
java.lang.Error: Probable fatal error:No fonts found.
	at sun.font.SunFontManager.getDefaultPhysicalFont(SunFontManager.java:1236)[:1.8.0_112]
	at sun.font.SunFontManager.initialiseDeferredFont(SunFontManager.java:1106)[:1.8.0_112]
	at sun.font.CompositeFont.doDeferredInitialisation(CompositeFont.java:263)[:1.8.0_112]
	at sun.font.CompositeFont.getSlotFont(CompositeFont.java:352)[:1.8.0_112]
	at sun.font.CompositeStrike.getStrikeForSlot(CompositeStrike.java:78)[:1.8.0_112]
	at sun.font.CompositeStrike.getFontMetrics(CompositeStrike.java:93)[:1.8.0_112]
	at sun.font.Font2D.getFontMetrics(Font2D.java:415)[:1.8.0_112]
	at java.awt.Font.defaultLineMetrics(Font.java:2176)[:1.8.0_112]
	at java.awt.Font.getLineMetrics(Font.java:2283)[:1.8.0_112]
	at java.awt.font.TextLayout.fastInit(TextLayout.java:598)[:1.8.0_112]
	at java.awt.font.TextLayout.<init>(TextLayout.java:393)[:1.8.0_112]
<cut>

Please note:
Issues are to be submitted here:

Thanks,
Chris

Hi! The docker documentation was updated today on Dockerhub and Github. The behaviour in working with docker mounted volumes has been changed to stay closer to the docker defaults. In the past the configuration files where copied to the docker mounted directory at the first start and owned by user id 1000. There where different problems with that approach. See the closed bugs on Github for details.

We have implemented a more cleaner approach based on the docker best practices. The openhab user in the docker container starts now with uid 9001 by default. This means, that you need existing config files and set the right permission on your hosts data folder e.g.

chown 9001.9001 /opt/openhab -R

If you do not have configuration files yet, you can copy them from the docker image to the host before starting the container. Please refer to the documenataion for details.

All settings can be customized by the docker run command or a docker-compose.yml. We have working examples in the Github documentation at https://github.com/openhab/openhab-docker

It is very importend to understand how docker manages data in volumes. Please give yourself 15mins and read https://docs.docker.com/engine/tutorials/dockervolumes/

1 Like

OK noted, thanks

Thanks for the update.

I did spot the documentation on the docker hub that helped fix the fresh install issue, but the font problem remains.

However, I should note that the documentation here http://docs.openhab.org/installation/docker.html does not mention about this copying of files needed.

Can I suggest you have ONE place for the docker documentation (docs.openhab.org seems the most relevant) covering install and then on docker hub and github simply provide a link back to docs.openhab.org - otherwise you are going to have to maintain up to 3 separate copies…

Hi. I am with you. But i think the main documentation should be maintained, where the opennhab-docker project is developed. So referencing from docs.openhab.org to openhab-docker makes more sense. I dont want to check out two git repositories and create 2 pull requests for each change i make :slight_smile:

1 Like

Please, can anyone help with this chart issue, none of my charts work anymore ?

Never mind, found the issue

Since I also experienced this issue, could you share what you did to solve it?
Thanks!

@fireplex what solved the graphing issue for you? I’m still experiencing it :slightly_frowning_face:

It’s an issue with the docker, see https://github.com/openhab/openhab-docker/issues/73

Same issue here:

2.5.0-SNAPSHOT Build #1719
Intel® Celeron® CPU J1900 @ 1.99GHz
openhabian istallation - not docker

EDIT: worked fine a few snapshots befor

2019-10-12 17:40:40.662 [WARN ] [org.eclipse.jetty.server.HttpChannel] - /chart
java.lang.Error: Probable fatal error:No fonts found.
at sun.font.SunFontManager.getDefaultPhysicalFont(SunFontManager.java:1236) ~[?:?]
at sun.font.SunFontManager.initialiseDeferredFont(SunFontManager.java:1106) ~[?:?]
at sun.font.CompositeFont.doDeferredInitialisation(CompositeFont.java:287) ~[?:?]
at sun.font.CompositeFont.getSlotFont(CompositeFont.java:376) ~[?:?]
at sun.font.CompositeStrike.getStrikeForSlot(CompositeStrike.java:82) ~[?:?]
at sun.font.CompositeStrike.getFontMetrics(CompositeStrike.java:97) ~[?:?]
at sun.font.Font2D.getFontMetrics(Font2D.java:415) ~[?:?]
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.(TextLayout.java:393) ~[?:?]
at org.knowm.xchart.internal.chartpart.AxisTickCalculator.willLabelsFitInTickSpaceHint(AxisTickCalculator.java:148) ~[?:?]
at org.knowm.xchart.internal.chartpart.AxisTickDateCalculator.calculate(AxisTickDateCalculator.java:214) ~[?:?]
at org.knowm.xchart.internal.chartpart.AxisTickDateCalculator.(AxisTickDateCalculator.java:115) ~[?:?]
at org.knowm.xchart.internal.chartpart.Axis.getAxisTickCalculator(Axis.java:363) ~[?:?]
at org.knowm.xchart.internal.chartpart.Axis.getXAxisHeightHint(Axis.java:286) ~[?:?]
at org.knowm.xchart.internal.chartpart.Axis.paint(Axis.java:180) ~[?:?]
at org.knowm.xchart.internal.chartpart.AxisPair.paint(AxisPair.java:147) ~[?:?]
at org.knowm.xchart.internal.chartpart.ChartPainter.paint(ChartPainter.java:114) ~[?:?]
at org.knowm.xchart.Chart.paint(Chart.java:102) ~[?:?]
at org.eclipse.smarthome.ui.internal.chart.defaultchartprovider.DefaultChartProvider.createChart(DefaultChartProvider.java:277) ~[?:?]
at org.eclipse.smarthome.ui.internal.chart.ChartServlet.doGet(ChartServlet.java:332) ~[?:?]
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:873) ~[90:org.eclipse.jetty.servlet:9.4.18.v20190429]
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:542) ~[90:org.eclipse.jetty.servlet:9.4.18.v20190429]
at org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:71) ~[194:org.ops4j.pax.web.pax-web-jetty:7.2.10]
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:146) ~[89:org.eclipse.jetty.server:9.4.18.v20190429]
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548) ~[87:org.eclipse.jetty.security:9.4.18.v20190429]
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132) ~[89:org.eclipse.jetty.server:9.4.18.v20190429]
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:257) ~[89:org.eclipse.jetty.server:9.4.18.v20190429]
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1700) ~[89:org.eclipse.jetty.server:9.4.18.v20190429]
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255) ~[89:org.eclipse.jetty.server:9.4.18.v20190429]
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1345) ~[89:org.eclipse.jetty.server:9.4.18.v20190429]
at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:293) ~[194:org.ops4j.pax.web.pax-web-jetty:7.2.10]
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:203) ~[89:org.eclipse.jetty.server:9.4.18.v20190429]
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:480) ~[90:org.eclipse.jetty.servlet:9.4.18.v20190429]
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1667) ~[89:org.eclipse.jetty.server:9.4.18.v20190429]
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:201) ~[89:org.eclipse.jetty.server:9.4.18.v20190429]
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1247) ~[89:org.eclipse.jetty.server:9.4.18.v20190429]
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:144) ~[89:org.eclipse.jetty.server:9.4.18.v20190429]
at org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:80) ~[194:org.ops4j.pax.web.pax-web-jetty:7.2.10]
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132) ~[89:org.eclipse.jetty.server:9.4.18.v20190429]
at org.eclipse.jetty.server.Server.handle(Server.java:505) ~[89:org.eclipse.jetty.server:9.4.18.v20190429]
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:370) [89:org.eclipse.jetty.server:9.4.18.v20190429]
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:267) [89:org.eclipse.jetty.server:9.4.18.v20190429]
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:305) [80:org.eclipse.jetty.io:9.4.18.v20190429]
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103) [80:org.eclipse.jetty.io:9.4.18.v20190429]
at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117) [80:org.eclipse.jetty.io:9.4.18.v20190429]
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:333) [92:org.eclipse.jetty.util:9.4.18.v20190429]
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:310) [92:org.eclipse.jetty.util:9.4.18.v20190429]
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:168) [92:org.eclipse.jetty.util:9.4.18.v20190429]
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:126) [92:org.eclipse.jetty.util:9.4.18.v20190429]
at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:366) [92:org.eclipse.jetty.util:9.4.18.v20190429]
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:698) [92:org.eclipse.jetty.util:9.4.18.v20190429]
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:804) [92:org.eclipse.jetty.util:9.4.18.v20190429]
at java.lang.Thread.run(Thread.java:748) [?:?]