"Unable to connect to Home Assistant" unless in incognito mode

I’ve been having this issue for a long time with my HA installation, when I browse to my Nuba Casa URL (e.g. https://xxxxxxxxxxx.ui.nabu.casa/) I keep getting an “Unable to connect to Home Assistant.” message. I’ve had this message in multiple browsers and devices, including in the HA iOS app.

The only consistent way I’ve found to circumvent it is by opening a private browsing session, or by wiping the client cache in the HA app. Even doing an “Empty Cache and Hard Reload” in Chrome doesn’t solve the issue, I have to do a full “Clean Storage” for the site in Chrome’s dev tools.

I’ve tried playing around with numerous settings but at this point I’m stumped. There are no errors in the browser dev console or problems with any of the network requests.

Edit, some extra details:

  • I’m running on a Pi4 with SSD - but also had the problem when I ran on a Tinkerboard from an SD Card
  • HA version 2020.12.6 - but have had the problems for at least all versions in the past 6 months
  • OS version 5.8 - but again have had the problems for at least all versions in the past 6 months
3 Likes

I’m having the same problem, HA randomly fails to load in a regular browser session, but works fine on non-incognito mode.

My HA is behind an nginx reverse proxy. Sometimes on firefox I see errors about a failure to establish a websocket connection. However, nginx appears to be configured properly to proxy the websocket connections, and indeed the incognito-mode session works fine.

In my regular Firefox session, the websocket error appears to have spontaneously fixed itself and I can access HA from there.

Like the OP, I’ve had some limited luck in chrome after clearing the cache and site data for the specific HA site.

Is it possible that the HA front-end is caching the address of the HA socket and API backends?

I’m using lovelace:

Home Assistant

  • Core2024.4.2
  • Supervisor2024.04.0
  • Operating System
  • Frontend20240404.1