BasicUI not loading any css or icons after reboot

Running on a RaspberryPi, Openhab 4.0.0.M1, Debian, using BasicUI.

I rebooted my pi, therefore restarting Openhab. My BasicUI is still opening, but with no stylesheets, icons etc - just the base HTML page.

I have tried restarting, upgraded to the latest (4.0.0.M1), but still it’s behaving the same. I have also tried removing and reinstalling BasicUI.

It looks to me sort of like either a permissions issue on the file system, or perhaps a missing bundle, or perhaps something else.

Things I can see:

  • in the command line I do have both the BasicUI bundle and the standard icons bundle, and both are active
  • the behaviour is the same on Safari and Chrome
  • it was running fine before the restart, so unlikely to have been caused by an upgrade (and I hadn’t upgraded for a few months prior to this)
  • the Safari console is giving a file not found on all the icons, and errors on lots of files. Interestingly, a number of files (including manifest.json and the javascript) appear to have the base html page in the content - which is making the parser unhappy as that page is neither a valid json file nor a valid script

I can provide more details, but I’m not sure what direction to go in for debugging/investigation. I can see from google that the underlying files aren’t stored in a single location, rather they are generated at run time - so there’s not a directory I can go and look in to see the icons, for example.

Any tips or suggestions on what to look at?

Openhab itself is running, and the log looks pretty much as it normally does (no unexpected errors).

Ctrl + F5 ?

are there any other non-active bundles ?

ramp up debugging on org.openhab and org.apache, eventually to see if that gives a hint

on a sidenote, I have difficulties with tracker blocking enabled in Firefox, try playing with that.
Also try removing cookies and sessions credentials (access from the MainUI main menu)

Tried this, no difference. I’ve also tried using an entirely different browser (i.e. moving from Safari to Chrome), so I don’t think it’s a cookie or refresh issue.

No non-active bundles.

I don’t think it’s tracker blocking given I get it both on Safari and Chrome. I also just tried my phone, and I get the same issue using Safari on my phone, but I don’t get the issue when coming in through the App (openhab cloud). Not sure if that means something, but I presume the app isn’t using basicui?

Ramping up logging on org.openhab, I see a bunch of errors like this:

2023-03-21 22:55:54.530 [DEBUG] [enhab.ui.internal.UIErrorPageServlet] - Returning index file as response with status 404 for request URI: /basicui/icon/switch
2023-03-21 22:55:54.546 [DEBUG] [enhab.ui.internal.UIErrorPageServlet] - Returning index file as response with status 404 for request URI: /basicui/icon/switch
2023-03-21 22:55:54.571 [DEBUG] [enhab.ui.internal.UIErrorPageServlet] - Returning index file as response with status 404 for request URI: /basicui/icon/switch

But nothing further up the log indicating any errors that might be causing that. I guess I could try a reboot with trace on, but I think that would generate a massive log and then I’m looking for a needle in that haystack.

I got nothing new from logging at TRACE level on org.apache.

I couldn’t find where cookies and session credentials are in the MainUI - I looked under settings, under pages, under user interfaces and under basic UI and can’t see anything obvious, any further pointers would be appreciated.

that’s right

click the lock icon at the bottom of the left hand side nav bar

OK, the sessions didn’t do anything either.

To me it seems that it’s clearly not finding the icons (and presumably the css and js also, although those aren’t showing in the error log). I’m assuming those are unpacked from the file and stored in a cache somewhere - it wouldn’t make sense to re-extract them each time a browser page refreshes. Where would they typically be stored, and where would they be extracted from?

If as you say you can reproduce it I’d rather believe it’s a 4.0 regression so suggest you open a Github issue for it.

I can do so. Is there additional information I can / should provide? Should I try the full trace and reboot, and see if I can find anything in the log? Perhaps a trace only on openhab.ui.internal?

Thanks, ticket raised: BasicUI not delivering CSS, JS or icons after reboot · Issue #1805 · openhab/openhab-webui · GitHub

I’m running openHAB 3.4.1 release and just today got the same issue as the OP. The file is indeed the same as index.
Before the error occurred, I was changing items, sitemap and py files, which were being uploaded using a very slow and error prone VPN connection.

The web browser reports these symptoms, placed here for searchability:

The stylesheet http://192.168.X.X:8080/basicui/app/smarthome.css was not loaded because its MIME type, “text/html”, is not “text/css”.
Uncaught SyntaxError: expected expression, got '<'[smarthome.js:1](http://192.168.X.X:8080/basicui/app/smarthome.js)

I think that particular error is because it’s returning the index page for everything - so it asked for a css and got an html back, and therefore gave an error that the document came back wasn’t css.

It would be useful if you followed through to the issue in GitHub and added a comment there - so they can see it’s impacting more than one person.

I solved the issue.

I was using the following URL, which does not work:

It does work when I use this URL, without trailing slash:

If you go to MainUI, click Other apps, BasicUI, then the correct URL is used.

I would say that is a bug. The existence or nonexistence of a trailing slash should not break an app.

1 Like