OH webserver throws NullPointerException

  • Platform information:
    • Hardware: Kubernetes on bare metal
    • OS: Docker on Kubernetes
    • Java Runtime Environment: Java included with latest Docker 2.4 image
    • openHAB version: Latest (as of writing) Docker 2.4 image

I’m running OH on Kubernetes using a slight modified copy of the stock Docker image. This works surprisingly well.

I believe the modification has nothing to do with my problem, but for good measure, here we go: I run a lot of ZWave, so I need a dongle, of course. As I cannot add hardware to containers running in Kubernetes, I have a Raspberry Pi with the my dongle running ser2net, and I have modified the Docker container to run socat before starting OH. The recipe can be found on this fine forum - it works very well even in Kubernetes.

However, some month ago after a 2.2 -> 2.2 update, the webserver started throwing NullPointerExceptions when accessing the server root. The server runs behind a Traefik load balancer that handles SSL encryption etc. - this had been working fine for a longer period and with a lot of upgrades - but 4-6 months ago it stopped working.

I may not have found out immediately as the Basic UI works fine. I have a bookmark for that and usually I test updates by just loading the UI in a browser. But I cannot access any other applications as I cannot find the proper URL, and the index at the server root throws the exception.

Log files does not give any clues as to what goes on.

Today, I decided to try a real upgrade from 2.2 -> 2.4. Everything works fine - except for the webserver that fails the same way as with 2.2.

API server works fine as well - I can control our home using the OH app on my Android phone.

But when I try to access the root of the webserver, I get the following exception:

HTTP ERROR 500

Problem accessing /start/index. Reason:

Server Error

Caused by:

java.lang.NullPointerException
at org.openhab.ui.dashboard.internal.DashboardService.getLocalizedText(DashboardService.java:240)
at org.openhab.ui.dashboard.internal.DashboardServlet.lambda$0(DashboardServlet.java:203)
at org.openhab.ui.dashboard.internal.DashboardServlet.replaceKeysWithFunction(DashboardServlet.java:217)
at org.openhab.ui.dashboard.internal.DashboardServlet.replaceKeysWithLocaleFunction(DashboardServlet.java:203)
at org.openhab.ui.dashboard.internal.DashboardServlet.serveDashboard(DashboardServlet.java:114)
at org.openhab.ui.dashboard.internal.DashboardServlet.doGet(DashboardServlet.java:80)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
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)

Regards,
Lars

Oops, sorry - I was still running 2.2 - I forgot to push my modified Docker image.

Now I do have 2.4 running with a lot of different problems: But I’m not getting those exceptions anymore. :slightly_smiling_face: