Cloudflare Tunnel - Connection lost, reconnecting

Was wondering if anyone else was experiencing random but common Home Assistant App disconnects using a Cloudflare tunnel? Previously, I was tunneling into a server on my LAN using NGROK to access HA and it was pretty solid. When I found I could save a few bucks a month using Cloudflare, I switched over. Here are the details:

  • Disconnects last anywhere from a few seconds to a few minutes.
  • They seem very random. More of a nuisance than anything.
  • It always reconnects eventually.
  • I use a separate server to run Cloudflared on my LAN and have multiple tunnels, but I also administer a friend’s Home Assistant (different network, single tunnel). His HA is on a Raspberry Pi and he uses the Cloudflared Add-on in Home Assistant. Both experience the same issue. Might be my imagination, but the disconnects seem to occur more often on the setup with the Cloudflared Add-on.

Anyway, was wondering if anyone might have any ideas to fix the issue, or if it is just a Cloudflare issue I have to live with. There are a few timeout settings you can change at Cloudflare (tunnel configuration). I have mine all set to the defaults.


Watching, I also see this issue. Using the Cloudflared add-on.

Looked at the add on logs seen a few of these errors

ERR Request failed error="Unable to reach the origin service. The service may be down or it may not be responding to traffic from cloudflared: dial tcp <ip>:8123: connect: connection refused" connIndex=2 dest=https://<url>/api/websocket event=0 ip= <ip> type=ws

ERR  error="Incoming request ended abruptly: context canceled" cfRay=7d35df052e6fb0c4-ATL event=1 ingressRule=0 originService=http://homeassistant:8123

ERR Request failed error="Incoming request ended abruptly: context canceled" connIndex=2 dest=<URL> ip=<ip> type=http