Main UI loses connection to openHAB

using openHAB 4.1.0 Release Build on openHABian v1.8b.

I experience the following behaviour with openHAB4 since a few releases, but now it feels more rapidly that this happens:

What I do:

  1. open openHAB in a new browser-session
  2. I’m logged in via Cookie
  3. I use the MainUI
  4. I open multiple TABs (items, rules, things,…)
  5. after some time MainUI loses the connection to openHAB
    5.1 rules won’t get saved anymore
    5.2 items dont’ get loaded/…
    5.3 things don’t get loaded
    5.4 pages won’t update
    5.5 bindings can’t be searched/…
  6. restarting the browser fixes this => started with (1)

If I open /profile, there’s a bunch of sessions, but only one for each client with either IP or FDQN on my openHAB-Server.

The error is regardles the browser, it happens in Firefox, Chrome and Edge (Chromium) the same.

Are you using HTTP or HTTPS? I remember seeing an issue or maybe a PR go by that talked about the SSE event stream isn’t always working right with HTTP. Could be related, could be completely unrelated.

It’s http for me.
and I remembered the F12-console for “network analysis”.

What appears to be the problem is MainUI losing authorization, as the XMLHttpRequest (e.g. /rest/items?metadata=semantics) throw an 401 if that happens. Funnily enough, if I use the F12-console, it seems(?) to be “self-repairing”, as after an 401 i can more often seem to call through in other MainUI categories…? The previous 401 changes to a 200 after a click again…

In programming we jokingly call that a Heisenbug.. It might be worth an issue but I don’t know if there is enough information here yet to reproduce and diagnose the problem.

i can always reproduce this with the numbererd steps in the initial post. If noone else can, then it’s my environment! :wink:

I can somewhat confirm this error. UI feels sluggish, and randomly it takes like 20s to refresh pages. Also, when needed to pick something from a list (f.e. pick mqtt broker when adding a mqtt thing, or selecting a thing to create equpiment from). Also can confirm that the issue goes away immediately when I use https access instead of http.

EDIT: ok just as I wrote this, the issue returned on https as well. Confused to say the least.

I’m using fresh install, dockerized latest official image.

To add to it, I’ve watched the F12 console and requests to /events endpoint amass very long wait times.

https://carter.os:8443/rest/events?topics=openhab/items/*/added,openhab/items/*/updated,openhab/items/*/removed

shows over 5 mins now, and the message “Warning, this request has not been finished yet”. It has a 200 OK status.

Another update.

I tried Edge. And to my surprise, it’s day and night. Yes, every now and then the issue appears, but all I need is to open the UI in new tab every 30 mins or so and it works. While in chrome it was unusable.

Weird issue.