Yesterday i occasionally run into this problem. Figured it out this time.
I’ve never had it before and that was a surprise. Plus, i was working on a different project, and reconfigured my sitemap slightly to add controls for my new Thing under testing; so it felt like the change has caused it. Bottom line: it took some of my nerves, but i figured it out.
It turned out to be a coincidence. Recently flash drive in my PC died, so i reinstalled my Windows and whole software from scratch. Perhaps this changed some settings in Firefox. In order to go to my BasicUI, i typed a 192.168.X.X local address in a URL bar. And went there. And the browser chose to use http://, not https://. But BasicUI code internally insists on https:// to call a subscription URL. And here comes the problem: my browser blocks it because of CORS policy. I found this out in developer’s console.
To verify this, i went to the same IP using https://. I am using a self-signed certificate, so that was fine. After a warning i got a fully working BasicUI, no problem anymore.
Yesterday i failed to realize that could be the culprit; and simply ran with this error for some time. Because controls actually worked. And that eventually somehow led me to another error: SSE subscription failed. Which is also well-known, a suggested cure is to delete addons.conf (strange but okay)
So, perhaps i found two bugs:
Subscription URL is fully-specified including https:// protocol, which breaks CORS if the user uses http:// to get to the control panel. Maybe plain http is out of fashion, still you can get it simply by typing an IP. The problem is aggravated further by the fact that Firefox loves to hide protocol specifier from the URL bar, so you don’t see it. This is confusing. Shouldn’t openhab use just ‘/’ in this URL ? Or, if http if so much deprecated, simply redirect to https, so that this situation can never happen ?
Running for some time with “Offline” error eventually brings you into some compatibility mode, which may leak subscription descriptors somehow and trigger “SSE subscription failed”. It appeared not only on this PC, but on two my wall panels also; so that was quite a bad experience.