Main UI regularly crashes after a couple of days, browser stays blank

Hello,

since I started usage of JavaScript rules addons, I experience the issue, that the main ui simply does not load after 2 to 4 days. The website just stays blank. The issue is reproducable. Openhab continues to run. I see in the events.log that items are being updated and I can also log into the console. So to me it seems it is Main UI related.

Platform information:

  • Hardware: Raspberry Pi 4 Model B Rev 1.1 4GB RAM
  • OS: Raspbian GNU/Linux 10 (buster)
  • Java Runtime Environment: Environment Zulu11.50+19-CA (build 11.0.12+7-LTS)
  • openHAB version: 3.2
  • Issue: Main UI does not load. Screen stays blank

Solution attemps:

  1. Restarted all Main UI related bundles: no impact
186 x Active x  80 x 3.2.0                 x openHAB Core :: Bundles :: UI REST Interface
216 x Active x  80 x 3.2.0                 x openHAB Core :: Bundles :: UI
217 x Active x  80 x 3.2.0                 x openHAB Core :: Bundles :: UI Icon Support
219 x Active x  80 x 3.2.0                 x openHAB UI :: Bundles :: Main UI
274 x Active x  80 x 3.2.0                 x openHAB UI :: Bundles :: Basic UI
275 x Active x  80 x 3.2.0                 x openHAB UI :: Bundles :: Icon Set :: Classic

  1. Restart Openhab Service: Then it everything works for a couple of days.

Logs
In the logs I see the follwing WARN messages:

2022-02-01 07:16:38.523 [WARN ] [ternal.handler.HomematicThingHandler] - Channel not found for datapoint '000E5709B28DC3:1#QUICK_VETO_TIME'
2022-02-01 07:25:50.922 [WARN ] [e.internal.SseItemStatesEventBuilder] - Attempting to send a state update of an item which doesn't exist: undefined
2022-02-01 08:09:29.882 [WARN ] [ore.io.rest.auth.internal.AuthFilter] - Unauthorized API request: Error while processing JWT token
2022-02-01 08:18:34.985 [WARN ] [ternal.handler.HomematicThingHandler] - Channel not found for datapoint '000E5709B28D4B:1#QUICK_VETO_TIME'

and the following ERROR messages:

2022-01-30 10:04:30.437 [ERROR] [internal.JSONResponseExceptionMapper] - Unexpected exception occurred while processing REST request.
2022-01-30 15:07:28.560 [ERROR] [internal.JSONResponseExceptionMapper] - Unexpected exception occurred while processing REST request.
2022-01-30 16:19:17.719 [ERROR] [internal.JSONResponseExceptionMapper] - Unexpected exception occurred while processing REST request.

While generating the rules in JavaScript I also experienced stability issues as described in https://community.openhab.org/t/openhab-becomes-unstable-and-slow-after-ecma-11-rule-coding-errors/132506. But as of now there are no errors related to rules execution.

Anyone having similar issues? Restarting openhab is not a drama, but of course it would be great to no need to do that.

Many thanks for your ansers in advance.

1 Like

Check the heap size of your Java VM and check logs for heap memory errors. I have a lot of things and items and I had to increase the heap size in /etc/default/openhab.

EXTRA_JAVA_OPTS="-Xms192m -Xmx1512m"

thanks for your reply @stefaanbolle . I checked and I dont have heap errors in the log. I had only once when I somehow messed with a javascript rule and the system crashed. But that was only one entry in all logs.

2022-02-01 18:14:35.473 [WARN ] [org.eclipse.jetty.io.ManagedSelector] - java.lang.OutOfMemoryError: Java heap space

Today I updated to 3.3.M1 so I’ll observe if that brings any improvement.

so I also increased the heap size and upgraded to 3.3.0.M1, but after approx. Main UI stays again blank. Any ideas where to further investigate?

Karaf
  Karaf version               4.3.6
  Karaf home                  /usr/share/openhab/runtime
  Karaf base                  /var/lib/openhab
  OSGi Framework              org.eclipse.osgi-3.16.300.v20210525-1715

JVM
  Java Virtual Machine        OpenJDK Client VM version 11.0.12+7-LTS
  Version                     11.0.12
  Vendor                      Azul Systems, Inc.
  Pid                         11627
  Uptime                      1 day 22 hours
  Process CPU time            4 hours 20 minutes
  Process CPU load            0.03
  System CPU load             0.04
  Open file descriptors       381
  Max file descriptors        102,642
  Total compile time          25.480 seconds
Threads
  Live threads                286
  Daemon threads              132
  Peak                        291
  Total started               168704
Memory
  Current heap size           249,938 kbytes
  Maximum heap size           989,888 kbytes
  Committed heap size         495,424 kbytes
  Pending objects             0
  Garbage collector           Name = 'Copy', Collections = 2095, Time = 1 minute
  Garbage collector           Name = 'MarkSweepCompact', Collections = 5, Time = 1.793 seconds
Classes
  Current classes loaded      29,096
  Total classes loaded        29,184
  Total classes unloaded      88
Operating system
  Name                        Linux version 5.10.63-v7l+
  Architecture                arm
  Processors                  4

I guess you have the same SSE problem like a few others here.
See the ticket with all infos here .
I am currently testing if https connection solves the problem.
Do you have a secured or unsecured connection when UI freezes?

Thanks @Oliver2. Indeed it seems this is related to the SSE problem. Now I realize the issue started to appear when I started to use conditional formatting for oh-label-widgets as below. I use http, since I have not checked how to setup https.

Is there any way to restart a specific bundle, to get thue UI loading again? So far the only way for me is to restart openhab service.

component: oh-label-cell
config:
  action: analyzer
  actionAnalyzerCoordSystem: time
  actionAnalyzerItems:
    - anwesend
  color: "=(items.anwesend.state == 'ON') ? 'green' : 'gray'"
  expandable: false
  footer: "=(((items.dt_AnnickHandy_Online_latchange.state)) >
    ((items.dt_MadHandyOnline_Online_lastchanged.state))) ? 'changed: Annick '
    +  items.dt_AnnickHandy_Online_latchange.displayState : 'changed Mad: ' +
    items.dt_MadHandyOnline_Online_lastchanged.displayState"
  header: Anwesenheit
  icon: "=(items.anwesend.state == 'ON') ? 'oh:presence' : 'oh:presence-off'"
  item: anwesend
  label: =(items.AnnickHandy_Online.state) + ' | ' + items.MadHandy_Online.state
  on: true
  subtitle: Annick | Mad

I doubt that restarting openhab service will solve the problem. You better refresh the browser.
https is available out of the box. You just need to change the URL in the browser

https://openhab:8443/

You also need to import the certificate into your browser or operating system of the client to avoid error messages

Thanks for the hint, I will check if https works when http freezes the next time.

I was misleading. Restarting of course is not solving, but at least a workaround to access the MainUI. For me the webpage stays completely blank. I can not access it at all.

did you clean the cache?
what happens if you directly access a page like

openhab:8080/page/Overview

Will check next time it freezes if clean cache helps. Accessing other pages directly does not work.

misunderstanding. I thought you have a general problem with blank pages.
My suggestion to cleaning cache makes no sense as you have to stop and restart openhab service anyway

you need to run https right away to avoid a freeze. it is not a solution to fix the problem when UI freezes next time

Ok, I changed to https in my Android app and will only access https via chrome browser on my PC

@Oliver2. it seems using https only solved the problem for me. Main UI now stable since 3 days. Many thanks. But I assume the underlying issue still needs to fixed, right?

Karaf
  Karaf version               4.3.6
  Karaf home                  /usr/share/openhab/runtime
  Karaf base                  /var/lib/openhab
  OSGi Framework              org.eclipse.osgi-3.16.300.v20210525-1715

JVM
  Java Virtual Machine        OpenJDK Client VM version 11.0.12+7-LTS
  Version                     11.0.12
  Vendor                      Azul Systems, Inc.
  Pid                         31005
  Uptime                      3 days
  Process CPU time            6 hours 50 minutes
  Process CPU load            0.02
  System CPU load             0.05
  Open file descriptors       335
  Max file descriptors        102,642
  Total compile time          29.164 seconds
Threads
  Live threads                300
  Daemon threads              133
  Peak                        304
  Total started               249233
Memory
  Current heap size           238,690 kbytes
  Maximum heap size           989,888 kbytes
  Committed heap size         495,424 kbytes
  Pending objects             0
  Garbage collector           Name = 'Copy', Collections = 3274, Time = 1 minute
  Garbage collector           Name = 'MarkSweepCompact', Collections = 5, Time = 1.822 seconds
Classes
  Current classes loaded      29,447
  Total classes loaded        29,656
  Total classes unloaded      209
Operating system
  Name                        Linux version 5.10.63-v7l+
  Architecture                arm
  Processors                  4

what other problem do you have? sorry, I don‘t see it right now

I refer to the fact that http usage is causing this blank Main UI screen. Isn’t that a bug which should be fixed?

1 Like

there were changes to the model. people have reported blank pages and the reason for this is circular referencing of model tags.
If you have an item which belongs to a group and that is referenced to a location and the item is also referenced to the location then you have this kind of problem which leads to blank pages as MainUI is busy.
try to find that kind of referencing

Ok, i will take a look. Still interesting why this issue appears when using http only and not https

yes, indeed. unfortunately no developer noticed the ticket yet on github

Oliver
Please post link to github issue
edit: duh… I see you had posted previously above… thanks