#[RESOLVED] UI gets constantly reloaded (every few seconds)

1 messages · Page 1 of 1 (latest)

quartz hazel
#

Hi all,

A problem has recently started and i can't find the cause.

The UI constnatly gets reloaded. it happens every few seconds. Apart from slight blinking on dashboards it is particular annoying in things like node-red or Zigbee2MQTT which are now unusable.

The problem happens in all browsers, including mobile.

The HA instance has been mostly untouched for last 6 months, i have recently upgraded to newer version, but I do not know if that's what's causing it.
I have disabled ALL custom cards to test - no luck.
Logs don't give me any indication as to what it could be.

There is a console log: "Uncaught (in promise): message "Subscription not found"
However I can't figure out which subscription is missing of even if this is the cause of reloads or a symptom of them.

I would be very grateful for any advice or help on how to troubleshoot this problem.

frail mauve
#

already performed reboot?

quartz hazel
#

yes, it's a docker based installed on a minipc. Rebooted, restarted, everything

#

i've just enabled system wide debug logging and digging through that, disabling integrations one at a time

#

so far no luck

frail mauve
#

best thing to do indeed, take your time when checking.

quartz hazel
#

is there anything i can do to find which subscription it's not happy about?

frail mauve
#

would check integrations that need subs.

quartz hazel
#

oh, not all of them do? how can i try to find out which integration it could be?

frail mauve
#

would start with integrations that heve a web/globe symbol.

runic glacier
#

Try Safe Mode?

quartz hazel
#

i wiped the config directory (backed it up) to reset HA fully. it's still happening, i really don't understand how

#

it's essentially a fresh install

runic glacier
#

What does 'reloading' mean exactly? A screen recording may be useful to explain what you mean.

quartz hazel
#

essentially the right pane refreshes itself. i do not get the full loading widget like ctrl-r does, but the part of dashboard gets reloaded.

it's annoying both because there is a visible twitch when reload happens, but worst part is that it closes all pop up menus. it is impossible to edit the dashboard because of it (you have 1-2 seconds to make the change, or the menu is gone)

#

sub pages like nodered are completely unusable as it takes about 2 seconds to fully load it's UI, and it reloads shortly after

#

the tricky part is that i can't seem to find what the missing subscription is

runic glacier
#

find what the missing subscription is
I'm not sure that's really related.

quartz hazel
#

that is fair. it is entirely possible it's 2 different problems and the missing subscription error is a symptom of reload, not the cause of it

#

but it's the only lead i have 🙁

#

what i've done so far:

  • completely reset hass-config directlry and set up HA fresh
  • tried HA core 2025.9.4, 2025.10.1, 2025.10.3
  • shut down nodered, esphome and frigate containers
  • tried different browsers

the reloads persist

runic glacier
#

Hmm not really sure, never heard of anything like that.
Just for my curiousity, can you restart HA in safe mode, and take a short screen recording of the issue in safe mode?

#

just like the full browser window

quartz hazel
#

let me try that, i didnt' even know safemode existed

runic glacier
#

It's in the reboot dialog, advanced options

quartz hazel
#

yup, still happening in safe mode

runic glacier
#

So I guess it's not just the right pane, looks like it's the whole window

quartz hazel
#

though in safe mode it seems to do full page reload, not just the dashboard pane

runic glacier
#

oh that's different?

quartz hazel
#

it appears to be slightly different behaviour yes - reload is still there. but in safe mode it does full page reload.

#

let me go back to normal and check

#

yeah, it's limited 'light' reload in normal mode, full page reload in safe

runic glacier
#

Does anything else get printed in the browser console, besides the subscription thing

quartz hazel
#

sadly no

#

i can see this message in debug logs of HA. but only extra bit of info it gives me is message ID

#

tracing that back to subscribe event yielded no usable results

#

oh, new data point!

going directly to <localip>:8123/ **does not ** seem to have this problem.

loading UI via nginx proxy does

runic glacier
#

I feel like I see that sometimes too, it's probably just a side effect of reloading the page.

quartz hazel
#

looks like thats where the issue is - and it kinda makes sense as the problem survived full HA wipe and reset

runic glacier
#

The only real thing I was thinking was it seems maybe related to the websocket losing connection to the server, but I couldn't think of a good way to prove that.

#

If it's some advanced networking thing on your network probably can't help there 😅

quartz hazel
#

i'd expect to see some errors on that front. but i do see new websocket connections being made

#

it's just standard docker contaiuner with nginx proxy

#

but it seems i have a new lead to dig thgough now

#

@runic glacier by the way, thank you very much for going through this with me!

runic glacier
#

There's also a debug toggle hidden in the upper right of developer tools. I don't know if it will be helpful.

#

It's more of like for debugging service calls and such, but it will probably cause more log spew

quartz hazel
#

this is nice! it's same stuff that is burried deep in the logs and was a rather annoying to piece together.

Thanks!

runic glacier
#

That get_config is probably from this:

    protected hassReconnected() {
      super.hassReconnected();

      this._updateHass({ connected: true });
      broadcastConnectionStatus("connected");

      // on reconnect always fetch config as we might miss an update while we were disconnected
      // @ts-ignore
      this.hass!.callWS({ type: "get_config" }).then((config: HassConfig) => {
        if (config.safe_mode) {
          // @ts-ignore Firefox supports forceGet
          location.reload(true);
        }
        this._updateHass({ config });
        this.checkDataBaseMigration();
      });
    }
quartz hazel
#

i think your websocket connection theory is the most likely culprit atm

runic glacier
#

That explains why safe mode reloads more

#

so yeah it definitely probably thinks it has lost and regained server connection

quartz hazel
#

the websocket ocnnection shows this on every connection attempt

runic glacier
#

🤷

#

You can try run this in your console:

document.getElementsByTagName("home-assistant")[0].hass.connection.addEventListener("disconnected", () => { console.log("HASS Disconnected!") })
#

Won't tell you why though.

quartz hazel
#

yup, it disconnects

#

to confirm, it is the websocket connection that is causing this? nothing else can?

runic glacier
#

I don't know

quartz hazel
#

well, this is massive progress. went from being completely blind to having a culprit.

Everything appears to work fine without nginx in front of HA.

#

can't yet see what's wrong with nginx, the config is super standard, up to date, with no funny business.

it also hasn't been touched in 8 months

#

but i'll keep digging

runic glacier
#

Could try logout and log back in if you haven't in a while.

quartz hazel
#

i did, multiple times. also wiped browser cache completely, tried incognito mode, different browsers

runic glacier
#

I'll step out now but best of luck, sounds frustrating 😅

quartz hazel
#

thank you for your time and help!

#

@runic glacier got it! i think...

added an explicit location block for /api/websocket to nginx config that sets the upgrade header to "websocket" instead of "$http_upgrade"

it fixes the reloads and websocket reconnects. and commenting out this block brings the problem back reliably.

#

still don't know..... what it didn't like in the original config but hey, this works!

#

[RESOLVED] UI gets constantly reloaded (every few seconds)

quartz hazel
#

@runic glacier sloowly bringing HA back online. restoring from backup wasn't as painless as i hoped. I really need to fix that up.

but so far everything that does work works well

frail mauve
#

then you can mark your thread as resolved 😉

quartz hazel
frail mauve
#

where you set UI/UX when you made the thread, checkbox resolved.

quartz hazel
#

aah, it's in tags?