New Add-On: Cloudflared

May be the same root cause as https://github.com/brenner-tobias/addon-cloudflared/issues/141

1 Like

Maybe, I had the watchdog turned on and the add-on was still found to be stopped.

Anyone know how to access config for this add-on via CLI?
(have a remote instance I can only get to via CLI after gofing up tunnel API token setting)

I managed to uninstall and reinstall, but how to provide settings for addon via CLI?

Is it possible to run both the cloudflared add on for remote access via the tunnel and the cloudflared integration to update other dns records on the domain, not related to my ha instance?

Hi @marce14-git , can you explain step by step? I’m kind of a newbie here :slight_smile:

What do you mean by create a new application? And then create bypass ?

Thanks in advance

yeah u get 404 if you try to reach the site with a browser but the mobile app can now talk with Home Assistant and Siri does work like before.

  1. Just configure your cloudflare HA addon and cloudflare zero trust as in any of the guides provided with subdomain.domain.com (= HA external URL) and with the authentication method of your choice (google does not work on mobile though)

  2. add another application in cf zero trust with subdomain.domain.com/api and create a bypass policy for everyone or by country etc. - you dont have to change ANYTHING in the HA cloudflare addon config

  3. everything should work (at least on iOS for me)

2 Likes

application and bypass is all on the cloudflare zero trust homepage - its pretty self explanatory

1 Like

Hi Guys,
I was following this guide from YT as it seems simple and with all info:

Unfortunately I’m constantly getting error:

[11:17:41] WARNING: Connection unavailable, rechecking in 5 seconds.
[11:17:41] WARNING: Connection attempt 1/24 before restart.

@vandenbogerd @pifuvalentin
Guys,
Did You resolve this issue by anychance?

I have the same problem.

@shade.pl @bennettTBCASoft

Could you share some more details on the issue you experience?

The warning below isn’t a problem during startup phase of the add-on.

[11:17:41] WARNING: Connection unavailable, rechecking in 5 seconds.
[11:17:41] WARNING: Connection attempt 1/24 before restart.

Regarding the background of the message, there is a health check built into the add-on that restarts the tunnel if no connection to the tunnel can be established for 2 minutes (24 attempts with a 5 second pause). During the add-on start it can happen that the connection is not available for a short time because the healthcheck performs a check before the initial connection is established.

The health check is advantageous when the network connection drops during normal operation of the tunnel. Cloudflare only tries to reconnect a few times, after which the service simply continues to run without a connection being established. This is where the implemented healthcheck comes into play as a workaround to restart the service.

I also have this same issue of late. My external connection kept dropping every few minutes but my internal connection was fine. I have the same error in the logs as the many people above me.

I have disabled and uninstalled cloudflared and reinstalled it. Same issue.

Which version are you running? v2.0.9 (released 3h ago) fixes an issue with watchdog.

i updated to 2.0.9 as soon as it was released. The issue i originally saw maybe 1 day ago. Not to say it started then, but it is when i saw it.

Right now my logs have the same error showing as of 1 hour 38 minutes ago.

s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
cont-init: info: running /etc/cont-init.d/00-banner.sh
-----------------------------------------------------------
 Add-on: Cloudflared
 Use a Cloudflared tunnel (formerly Argo Tunnel) to remotely connect to Home Assistant without opening any ports
-----------------------------------------------------------
 Add-on version: 2.0.9
 You are running the latest version of this add-on.
 System: Home Assistant OS 8.4  (amd64 / qemux86-64)
 Home Assistant Core: 2022.8.4
 Home Assistant Supervisor: 2022.08.3
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
cont-init: info: /etc/cont-init.d/00-banner.sh exited 0
cont-init: info: running /etc/cont-init.d/01-log-level.sh
cont-init: info: /etc/cont-init.d/01-log-level.sh exited 0
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service init-cloudflared-log: starting
s6-rc: info: service init-cloudflared-log successfully started
s6-rc: info: service init-cloudflared-config: starting
[10:41:38] INFO: Checking Add-on config...
[10:41:39] INFO: Checking for existing certificate...
[10:41:39] INFO: Existing certificate found
[10:41:39] INFO: Checking for existing tunnel...
[10:41:39] INFO: Existing tunnel with ID xxxxxxx found
[10:41:39] INFO: Checking if existing tunnel matches name given in config
[10:41:39] INFO: Existing Cloudflare tunnnel name matches config, proceeding with existing tunnel file
[10:41:39] INFO: Creating config file...
[10:41:40] INFO: Validating config file...
Validating rules from /tmp/config.json
OK
[10:41:40] INFO: Creating new DNS entry xxxxxxx...
2022-08-15T13:41:41Z INF xxxxxxx is already configured to route to your tunnel tunnelID=xxxxxxx
[10:41:41] INFO: Finished setting-up the Cloudflare tunnel
s6-rc: info: service init-cloudflared-config successfully started
s6-rc: info: service cloudflared: starting
s6-rc: info: service cloudflared successfully started
s6-rc: info: service healthcheck: starting
s6-rc: info: service healthcheck successfully started
s6-rc: info: service legacy-services: starting
[10:41:41] INFO: Starting Cloudflared Healthcheck for Home-Assistant add-on.
s6-rc: info: service legacy-services successfully started
[10:41:42] INFO: Connecting Cloudflared Tunnel...
2022-08-15T13:41:42Z INF Starting tunnel tunnelID=xxxxxxx
2022-08-15T13:41:42Z INF Version 2022.8.0
2022-08-15T13:41:42Z INF GOOS: linux, GOVersion: go1.18, GoArch: amd64
2022-08-15T13:41:42Z INF Settings: map[config:/tmp/config.json cred-file:/data/tunnel.json credentials-file:/data/tunnel.json loglevel:info metrics:0.0.0.0:36500 no-autoupdate:true origincert:/data/cert.pem]
2022-08-15T13:41:42Z INF Generated Connector ID: xxxxxxx
2022-08-15T13:41:42Z INF Initial protocol quic
2022-08-15T13:41:42Z INF Starting metrics server on [::]:36500/metrics
[10:41:42] WARNING: Connection unavailable, rechecking in 5 seconds.
[10:41:42] WARNING: Connection attempt 1/24 before restart.
2022-08-15T13:41:42Z INF Connection xxxxxxx registered connIndex=0 ip=198.41.200.33 location=ORD
2022-08-15T13:41:42Z INF Connection xxxxxxxregistered connIndex=1 ip=198.41.192.27 location=EWR
2022-08-15T13:41:43Z INF Connection xxxxxxx registered connIndex=2 ip=198.41.200.23 location=ORD
2022-08-15T13:41:44Z INF Connection xxxxxxx registered connIndex=3 ip=198.41.192.37 location=EWR

The log looks correct, the connection was established. What problems do you currently have with the tunnel?
As I said, the “Warning” is no problem.

For me the issue was that when accessing via external URL the connection would drop every few minutes, something like when you manually restart. But this was not occurring when viewing internally, this is what led me to check the cloudflared logs as I knew the system was not actually restarting.

Id have to be looking at the dashboard for a while in order to catch it but it was causing some automations to fail.

I havent spent a long time watching the dashboard this morning as Ive been at work but I will monitor as soon as I have a chance to and see if 2.0.9 fixed this earlier (i switched watchdog off prior to that update as i wanted to disable the add-on for a short while, I have re enabled watchdog now).

This should be fixed with 2.0.9

1 Like
-----------------------------------------------------------
 Add-on: Cloudflared
 Use a Cloudflared tunnel (formerly Argo Tunnel) to remotely connect to Home Assistant without opening any ports
-----------------------------------------------------------
 Add-on version: 2.0.9
 You are running the latest version of this add-on.
 System: Home Assistant OS 8.4  (amd64 / qemux86-64)
 Home Assistant Core: 2022.7.5
 Home Assistant Supervisor: 2022.08.3
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
cont-init: info: /etc/cont-init.d/00-banner.sh exited 0
cont-init: info: running /etc/cont-init.d/01-log-level.sh
cont-init: info: /etc/cont-init.d/01-log-level.sh exited 0
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service init-cloudflared-log: starting
s6-rc: info: service init-cloudflared-log successfully started
s6-rc: info: service init-cloudflared-config: starting
[16:22:28] INFO: Checking Add-on config...
[16:22:29] INFO: Checking for existing certificate...
[16:22:29] INFO: Existing certificate found
[16:22:29] INFO: Checking for existing tunnel...
[16:22:29] INFO: Existing tunnel with ID 3baee181-e604-4b1b-9c2d-0c5287b5f0ec found
[16:22:29] INFO: Checking if existing tunnel matches name given in config
[16:22:30] INFO: Existing Cloudflare tunnnel name matches config, proceeding with existing tunnel file
[16:22:30] INFO: Creating config file...
[16:22:30] INFO: Validating config file...
Validating rules from /tmp/config.json
OK
[16:22:31] INFO: Creating new DNS entry ...
2022-08-15T14:22:32Z INF kyoshiro.cf is already configured to route to your tunnel tunnelID=3baee181-e604-4b1b-9c2d-0c5287b5f0ec
[16:22:32] INFO: Finished setting-up the Cloudflare tunnel
s6-rc: info: service init-cloudflared-config successfully started
s6-rc: info: service cloudflared: starting
s6-rc: info: service cloudflared successfully started
s6-rc: info: service healthcheck: starting
s6-rc: info: service healthcheck successfully started
s6-rc: info: service legacy-services: starting
[16:22:32] INFO: Starting Cloudflared Healthcheck for Home-Assistant add-on.
s6-rc: info: service legacy-services successfully started
[16:22:32] INFO: Connecting Cloudflared Tunnel...
2022-08-15T14:22:32Z INF Starting tunnel tunnelID=3baee181-e604-4b1b-9c2d-0c5287b5f0ec
2022-08-15T14:22:32Z INF Version 2022.8.0
2022-08-15T14:22:32Z INF GOOS: linux, GOVersion: go1.18, GoArch: amd64
2022-08-15T14:22:32Z INF Settings: map[config:/tmp/config.json cred-file:/data/tunnel.json credentials-file:/data/tunnel.json loglevel:info metrics:0.0.0.0:36500 no-autoupdate:true origincert:/data/cert.pem]
2022-08-15T14:22:32Z INF Generated Connector ID: a765cacb-f4f9-4408-af2c-3b9fcad9bfc1
2022-08-15T14:22:32Z INF Initial protocol quic
2022-08-15T14:22:32Z INF Starting metrics server on [::]:36500/metrics
[16:22:32] WARNING: Connection unavailable, rechecking in 5 seconds.
[16:22:32] WARNING: Connection attempt 1/24 before restart.
2022-08-15T14:22:33Z INF Connection b16c2b94-a0fe-4f37-a90b-99fbb192c4c9 registered connIndex=0 ip=198.41.200.23 location=WAW
2022-08-15T14:22:33Z INF Connection 1e097c05-f729-4d33-b16b-c70cbcbabb0f registered connIndex=1 ip=198.41.192.37 location=PRG
2022-08-15T14:22:35Z INF Connection 48680c25-22a6-4dbc-83ac-a057c940bc19 registered connIndex=2 ip=198.41.200.33 location=WAW
2022-08-15T14:22:36Z INF Connection 6a864cfc-3a44-4e45-9f05-c82eda511920 registered connIndex=3 ip=198.41.192.7 location=PRG

This is mine full log of startup but it started working now. Sorry for false alarm.

1 Like

Hello.

I’m having a strange issue where the addon is on and working but HA shows it’s off and after a while it stops working. Here’s my log:

s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
cont-init: info: running /etc/cont-init.d/00-banner.sh
Add-on: Cloudflared
Use a Cloudflared tunnel (formerly Argo Tunnel) to remotely connect to Home Assistant without opening any ports
Add-on version: 2.0.11
You are running the latest version of this add-on.
System: Home Assistant OS 8.4 (amd64 / generic-x86-64)
Home Assistant Core: 2022.8.4
Home Assistant Supervisor: 2022.08.3
Please, share the above information when looking for help
or support in, e.g., GitHub, forums or the Discord chat.
cont-init: info: /etc/cont-init.d/00-banner.sh exited 0
cont-init: info: running /etc/cont-init.d/01-log-level.sh
cont-init: info: /etc/cont-init.d/01-log-level.sh exited 0
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service init-cloudflared-log: starting
s6-rc: info: service init-cloudflared-log successfully started
s6-rc: info: service init-cloudflared-config: starting
[21:55:58] INFO: Checking Add-on config…
[21:55:58] INFO: Checking for existing certificate…
[21:55:58] INFO: Existing certificate found
[21:55:58] INFO: Checking for existing tunnel…
[21:55:58] INFO: Existing tunnel with ID 658e6bdd-5b57-4cc7-b04c-f75f64b5cf07 found
[21:55:58] INFO: Checking if existing tunnel matches name given in config
2022-08-16T21:55:59Z WRN Your version 2022.8.1 is outdated. We recommend upgrading it to 2022.8.2
[21:55:59] INFO: Existing Cloudflare tunnnel name matches config, proceeding with existing tunnel file
[21:56:00] INFO: Creating config file…
[21:56:00] INFO: Validating config file…
Validating rules from /tmp/config.json
OK
[21:56:00] INFO: Creating new DNS entry casa.zirius.is…
2022-08-16T21:56:02Z INF casa.zirius.is is already configured to route to your tunnel tunnelID=658e6bdd-5b57-4cc7-b04c-f75f64b5cf07
[21:56:02] INFO: Finished setting-up the Cloudflare tunnel
s6-rc: info: service init-cloudflared-config successfully started
s6-rc: info: service cloudflared: starting
s6-rc: info: service cloudflared successfully started
s6-rc: info: service healthcheck: starting
s6-rc: info: service healthcheck successfully started
s6-rc: info: service legacy-services: starting
s6-rc: info: service legacy-services successfully started
[21:56:02] INFO: Starting Cloudflared Healthcheck for Home-Assistant add-on.
[21:56:02] INFO: Connecting Cloudflared Tunnel…
2022-08-16T21:56:02Z INF Starting tunnel tunnelID=658e6bdd-5b57-4cc7-b04c-f75f64b5cf07
2022-08-16T21:56:02Z INF Version 2022.8.1
2022-08-16T21:56:02Z INF GOOS: linux, GOVersion: go1.18.5, GoArch: amd64
2022-08-16T21:56:02Z INF Settings: map[config:/tmp/config.json cred-file:/data/tunnel.json credentials-file:/data/tunnel.json loglevel:info metrics:0.0.0.0:36500 no-autoupdate:true origincert:/data/cert.pem]
2022-08-16T21:56:02Z INF Generated Connector ID: 249aad0e-3e70-4bf2-a0fe-9af92692a227
2022-08-16T21:56:02Z INF Initial protocol quic
2022-08-16T21:56:02Z INF Starting metrics server on [::]:36500/metrics
2022-08-16T21:56:03Z WRN Your version 2022.8.1 is outdated. We recommend upgrading it to 2022.8.2
2022-08-16T21:56:03Z INF Connection a929c3ba-bb1b-4a72-9858-82b91736719a registered connIndex=0 ip=198.41.200.73 location=KEF
2022-08-16T21:56:04Z INF Connection 33e2abc2-89bf-4986-96bc-ed4e2668b6c2 registered connIndex=1 ip=198.41.192.227 location=LHR
2022-08-16T21:56:05Z INF Connection 52a131ab-ebff-4c05-8ece-04c561ce95a9 registered connIndex=2 ip=198.41.200.53 location=KEF
2022-08-16T21:56:06Z INF Connection ef4bc6ec-3e10-4024-9466-2eed2354fe25 registered connIndex=3 ip=198.41.192.27 location=LHR>

Here is also a picture that shows that everything is on but still off?

Thank you.

1 Like

When you say it’s on, that image says not so. It has a start button. Press it and see if it changes
Mine has a stop and restart and the dot is green. Maybe it’s stopped

It is on because the logs show the text I quoted above. If it was off there would be no logs.