403 error when accessing through cloudflare tunnel

Hello everyone,

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!

1 Like

Did you ever manage to find a solution to this? I’ve literally gone through all of the same as you.

I’ve just come up against the same issue - any insight would be much appreciated!
the IP ban file is empty, i’m not sure where to look next…

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:

  1. Open Cloudflare dashboard
  2. Select your domain
  3. 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.

Just connected another device that encountered the 403, and I can confirm that these steps also fix the issue:

  1. Open Cloudflare dashboard
  2. Click “Caching” on the left sidebar
  3. Under “Caching”, click “Configuration”
  4. Click “Purge Everything”

This fixes the 403 errors as well. So clearly the issue (in my case) seems to be with caching on cloudflare’s side.