I’ve been running my home assistant installation smoothly for over a year, but last week, I encountered an issue. I use the cloudflared addon and started receiving the “Unable to connect to Home Assistant. Retrying in …” error.
I tried waiting it out and rebooted my Dell Optiplex, but neither approach worked. Thinking it might be a USB issue, I replaced it with an external SSD and reinstalled Home Assistant. Unfortunately, the problem persisted, ruling out the USB or Dell Optiplex as the cause.
Interestingly, I could still access my installation through homeassistant:8123. After checking my cloudflared config and the cloudflare tunnel, both seemed error-free, and the tunnel was reported as healthy by Cloudflare.
Additionally, I noticed that occasionally, I get a 403 error when attempting to access via the domain name instead of the “Unable to connect to Home Assistant. Retrying in …” message.
All my components are updated to the latest versions, and I’ve reviewed both Cloudflare and Home Assistant logs without finding any related errors. Can anyone provide assistance or insights? Thanks!
I just encountered this error, exactly as described.
I think it’s due to some invalid cache on Cloudflare’s side. When it happens to you next, you should be able to fix it by doing this:
Open Cloudflare dashboard
Select your domain
On the side, enable “Development Mode” (this removes cloudflare’s caching)
If it works when you try again, then you know the issue was in cloudflare’s cache (which in my case, it was).
For me, enabling development mode, refreshing the affected devices and then disabling development mode was enough to get it working again. If it breaks again in the future, I might investigate cloudflare’s caching more deeply, but for now it’s all good.
You can also just purge your cloudflare cache from the dashboard as well, which should have the same effect. I just tested with “Development Mode” first, and so I only have that information right now. But since the issue was with the cache, just purging all of cloudflare’s cache should also fix the issue.