Home Assistant Login Fails Seemingly-Randomly

Hello friends,

I’m having trouble, at seemingly-random times (I have found no throughline), connecting to HA from my guest wifi network (via a local login or trusted network login, and the guest network is the only one with TN enabled). It just hangs, saying “Initializing…” (or with nothing but the HA logo). Then, at some point, redirects to the /lovelace auth callback, but that hangs with “Loading data” and a spinner. There’s nothing in the browser logs, no failed login attempts in my notifications, and nothing in the HA logs in the UI.

I have a URL with an A DNS record that points to 192.168.xxx.xxx and the server port is set to 443 and my certificates are valid (LE/cloudflare), and, again, this often works, but just stops sometimes.

Anyone have any idea where I can look to debug this? Or thoughts on why it might not work?

Are you running hairpin NAT on the router?

No, I have the not-feature-rich nest wifi (cheapest 6e one) router. I can “share” devices between the guest and regular networks (and I’ve done so, and it ostensibly works as I can access other devices from the guest network which are on the regular network, and ping/curl work from guest network to HA).

I’m using cloudflare for DNS.

When it fails, then try to ping the hostname and then connect to the IP address that it spits out.
It will fail on the certificate and that is okay, just accept the risk and see if you can get the HA page up.
This will show if it is a DNS issue.