openhab / openhab-core

Core framework of openHAB
https://www.openhab.org/
Eclipse Public License 2.0
912 stars 420 forks source link

Adding Frontail Link to /etc/openhab2/services/dashboard.cfg Breaks System #328

Closed gooselord-0 closed 2 years ago

gooselord-0 commented 6 years ago

I changed my hostname early on from openhabianpi to openhab. This change never propagated to the frontail url (it did to the others), and I also wanted to replace the frontail image on the dashboard.

So I made some additions to /etc/openhab2/services/dashboard.cfg. Then my system exploded: became unresponsive, generated a million errors in openhab.log, etc. I managed to reboot, and it exploded again.

I then encountered the same thing being discussed on the forums. The issue was apparently resolved by deleting /var/lib/openhab2/config/org/openhab/. I moved it to my home directory instead of outright deleting it, rebooted, and now my system works again.

But even after putting dashboard.cfg back in /var/lib/openhab2/config/org/openhab and rebooting, I'm still 500ing. Here's the output:

java.lang.NullPointerException
    at java.util.regex.Matcher.quoteReplacement(Matcher.java:701)
    at org.openhab.ui.dashboard.internal.DashboardServlet.lambda$1(DashboardServlet.java:208)
    at org.openhab.ui.dashboard.internal.DashboardServlet.replaceKeysWithFunction(DashboardServlet.java:217)
    at org.openhab.ui.dashboard.internal.DashboardServlet.replaceKeysFromMap(DashboardServlet.java:207)
    at org.openhab.ui.dashboard.internal.DashboardServlet.serveDashboard(DashboardServlet.java:96)
    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)
martinvw commented 6 years ago

Could you share your dashboard.cfg causing the problems, maybe @paulianttila can help in that case

gooselord-0 commented 6 years ago

Sure. I've since removed the frontail link, but before I did, /etc/openhab2/services/dashboard.cfg read:

openhabiandocs.link-name=openHABian Help
openhabiandocs.link-url=https://docs.openhab.org/installation/openhabian.html

find3.link-name=FIND3
find3.link-url=http://#local-ip-redacted#/view/dashboard/#family-name-redacted#
find3.link-imageurl=../static/find3.png

frontail.link-name=Frontail
frontail.link-url=http://openhab:9001
frontail.link-imageurl=../static/logs.png

grafana.link-name=Grafana
grafana.link-url=http://openhab:3000
grafana.link-imageurl=../static/grafana.png

Again, like the poster in the OpenHAB forums I linked to above, I had no issues until adding the Frontail configuration.

martinvw commented 6 years ago

Did you test the latest snapshot, we had this PR recently:

https://github.com/openhab/openhab-core/pull/282

gooselord-0 commented 6 years ago

No, I haven't actually tested anything in core outside the stable builds (except for a Z-Wave binding snapshot). I'll read up on how to do so, back up my system, and give it a shot as time permits. Thanks for looking into it!

wborn commented 2 years ago

The dashboard no longer exists in OH3.