Intermittent 'Unable to connect' loading error across all devices and various URLs but HA is still up

I have a very annoying issue with my HA setup. HA currently sits on an rPi4 on my network, cabled into the core of my LAN (direct access to wifi AP and to broadband firewall), which has sufficient memory free and sufficient CPU free at all times for me not to be concerned about performance. I have a significant number of entities (I’m not sure how to get a number of them but its over 1000) and a lot going on, plus a lot of HACS additions and other resources and dashboards, but by and large it runs happily with no problems. Its up to date.

I have three ways I can access it (same as everyone else does) - homeassistant.local, IP address, or proper FQDN (a duckdns address). It runs as HTTPS as I have it accessible externally (and I need to put nginx in to take that load off the core system as external access is extremely rare for me, but thats another day’s job). Of minor interest is that calls to the FQDN actually resolve to the external IP address, and traffic from internal hosts hairpins via my router and back to the pi, but as per below that fact is not a cause of the issues.

The problem is that intermittently I get endpoints (tablets, phones, laptops - I have them running all OSs and of all types!) randomly bring up either the status popup at the bottom saying connection lost, reloading, or the ‘front’ loading HA logo with ‘Unable to connect to Home Assistant’ and the countdown timer. It will happen on one browser or app on one device whilst I am happily still browsing on HA from another uninterrupted - by way of convenient example my tablet is beside me looping around the 59 second reload counter while I’m watching the logs and hunting around HA on my mac to see if I can see anything to add to this post.

Without fail, if I change the address being used in my browser (or HA app too) to a different one of those three options above, it will load fine. It fails equally on all three addresses too, so its not any single one causing the issues (its not SSL certificate erros, for example). I just slowly circulate round the three addresses across all my devices as this happens.

I can’t see anything in the logs either to show there had been an issue.

Has anyone got any idea whats happening?

–Chris

Bumping for visibility, not least because I just realised I forgot to add a category when I posted it, which wont have helped

You have a flat network or VPN network segments where some of the stuff is located?
Is your DNS set-up correctly on everything?

That is the 2 most provided solutions to what you describe. Maybe search a bit to see if you can find one of these and see if it answers your question.

Tips on Searching for Answers & Duplicate Topics in the Forum.

(Sorry for some reason I didn’t get a notification on this reply so totally missed it)

Flat network, no vpn, and an almost-CCIE Cisco network engineer so I’m pretty confident about my network. DNS is perfect, no issues with anything else ever (and I have about 90 connected devices that I would see failures on), and it doesn’t matter even if i move dns outside my network

It’s really wierd, because it’s working perfectly for ages then just stops and I need to move address. That can be that I am on IP and I need to move to URL using FQDN.

Now what I will say is that I have tried putting nginx in front of HA to offload the ssl, and that seems to have reduced the frequency of this problem massively. I have also found that Chrome on apple devices in particular sometimes seems to ignore my local DNS and tries to use Google DNS. I can see on packet captures it is calling Google DNS servers even though nothing is configured to use them. If I block the DNS to Google then the browser throws a complete fit and fails. That is just bizarre. When I have time I’ll investigate it further.

Chris

Beyond me, then.
BUT I would move this to Installation category because they have ideas on how to install, but also things happening with your installation/network and this qualifies for that.
And besides, not finding help in this category.

A very good suggestion. Thanks!