Cloudflared not working properly

I had cloudflared working perfectly.

For the purpose of creating a tutorial I uninstalled the cloudflared addon, deleted the domain from cloudflare.com and also cleared the nameserver of the domain and the few lines of code inside the configuration.yaml.

I was now trying to reinstall everything but something is not working properly.

I can already see the HA logo when I try to acces HA via my domain but there is this message:

Inside cloudflared I have the following logs:

----------------------------------------------------------
 Add-on: Cloudflared
 Use a Cloudflare Tunnel to remotely connect to Home Assistant without opening any ports
-----------------------------------------------------------
 Add-on version: 5.1.0
 You are running the latest version of this add-on.
 System: Home Assistant OS 11.4  (aarch64 / raspberrypi4-64)
 Home Assistant Core: 2024.1.5
 Home Assistant Supervisor: 2023.12.1
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
[17:36:38] INFO: Checking add-on config...
[17:36:39] INFO: Checking for existing certificate...
[17:36:39] INFO: Existing certificate found
[17:36:39] INFO: Checking for existing tunnel...
[17:36:39] NOTICE: No tunnel file found
[17:36:39] INFO: Creating new tunnel...
2024-01-27T16:36:40Z WRN Your version 2024.1.4 is outdated. We recommend upgrading it to 2024.1.5
failed to create tunnel: Create Tunnel API call failed: tunnel with name already exists
[17:36:40] FATAL: Failed to create tunnel.
    Please check the Cloudflare Zero Trust Dashboard for an existing tunnel with the name homeassistant and delete it:
    Visit https://one.dash.cloudflare.com, then click on Access / Tunnels
s6-rc: warning: unable to start service init-cloudflared-config: command exited 1
/run/s6/basedir/scripts/rc.init: warning: s6-rc failed to properly bring all the services up! Check your logs (in /run/uncaught-logs/current if you have in-container logging) for more information.
/run/s6/basedir/scripts/rc.init: fatal: stopping the container.

Can anyone help me? What’s wrong and how can I fix it?

Solution:

  1. Go to the cloudflare dashboard then click ā€œzero trustā€ in the menu on the right.
  2. Yes, you have to register with PayPal or Credit Card even for the free plan
  3. Now you are in the ā€œZero trust dahsboardā€.
  4. In the menu on the right go to Networks → tunnels.
  5. delete the existing tunnel
  6. YAY you’re done!
1 Like

ahhhh they want the credit card anyway now. Had this problem today too (until yesterday was all fine, I did all but still nto working


Add-on: Cloudflared
 Use a Cloudflare Tunnel to remotely connect to Home Assistant without opening any ports
-----------------------------------------------------------
 Add-on version: 5.1.2
 You are running the latest version of this add-on.
 System: Home Assistant OS 11.5  (amd64 / qemux86-64)
 Home Assistant Core: 2024.2.0
 Home Assistant Supervisor: 2024.01.1
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
[14:05:19] INFO: Checking add-on config...
[14:05:19] INFO: Checking for existing certificate...
[14:05:19] NOTICE: No certificate found
[14:05:19] INFO: Creating new certificate...
[14:05:19] NOTICE: 
[14:05:19] NOTICE: Please follow the Cloudflare Auth-Steps:
[14:05:19] NOTICE: 
Please open the following URL and log in with your Cloudflare account:

https://dash.cloudflare.com/argotunnel?aud=xxxxxxxxxxxxxxxxxxxxxxxxxxxx

Leave cloudflared running to download the cert automatically.
You have successfully logged in.
If you wish to copy your credentials to a server, they have been saved to:
/root/.cloudflared/cert.pem
[14:05:44] INFO: Authentication successfull, moving auth file to the '/data' folder
[14:05:44] INFO: Checking for existing certificate...
[14:05:44] INFO: Existing certificate found
[14:05:44] INFO: Checking for existing tunnel...
[14:05:44] NOTICE: No tunnel file found
[14:05:44] INFO: Creating new tunnel...
Tunnel credentials written to /data/tunnel.json. Keep this file secret. To revoke these credentials, delete the tunnel.

Created tunnel homeassistant with id 43821126-0fd8-4f76-8ab6-xxxxxxxxxx
2024-02-09T13:05:46Z WRN Your version 2024.1.5 is outdated. We recommend upgrading it to 2024.2.0
[14:05:46] INFO: Checking for existing tunnel...
[14:05:46] INFO: Existing tunnel with ID 43821126-0fd8-4f76-8ab6-bce4935xxxxxxx1 found
[14:05:46] INFO: Checking if existing tunnel matches name given in config
2024-02-09T13:05:46Z WRN Your version 2024.1.5 is outdated. We recommend upgrading it to 2024.2.0
[14:05:46] INFO: Existing Cloudflare Tunnel name matches config, proceeding with existing tunnel file
[14:05:46] INFO: Creating config file...
[14:05:46] INFO: Validating config file...
Validating rules from /tmp/config.json
OK
[14:05:47] INFO: Creating DNS entry ha.adregroup.it...
2024-02-09T13:05:48Z INF Added CNAME ha.myname.it which will route to this tunnel tunnelID=43821126-0fd8-4f76-8ab6-bce4935c70e1
[14:05:48] INFO: Finished setting up the Cloudflare Tunnel
[14:05:48] INFO: Connecting Cloudflare Tunnel...
2024-02-09T13:05:48Z INF Starting tunnel tunnelID=43821126-0fd8-4f76-8ab6-bce4935c70e1
2024-02-09T13:05:48Z INF Version 2024.1.5
2024-02-09T13:05:48Z INF GOOS: linux, GOVersion: go1.21.5, GoArch: amd64
2024-02-09T13:05:48Z 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]
2024-02-09T13:05:48Z INF Generated Connector ID: e6218bb4-775a-4238-8686-42c11ed1ebcf
2024-02-09T13:05:48Z INF Initial protocol quic
2024-02-09T13:05:48Z INF ICMP proxy will use 172.30.33.8 as source for IPv4
2024-02-09T13:05:48Z INF ICMP proxy will use :: as source for IPv6
2024-02-09T13:05:48Z INF Starting metrics server on [::]:36500/metrics
2024-02-09T13:05:48Z WRN Your version 2024.1.5 is outdated. We recommend upgrading it to 2024.2.0
2024-02-09T13:05:48Z INF Registered tunnel connection connIndex=0 connection=d0533929-e775-4bd3-b1a5-275f920b1165 event=0 ip=198.41.192.7 location=mxp03 protocol=quic
2024-02-09T13:05:48Z INF Registered tunnel connection connIndex=1 connection=821f1222-51f3-41a8-bbe4-51627505d4bd event=0 ip=198.41.200.43 location=fco01 protocol=quic
2024-02-09T13:05:49Z INF Registered tunnel connection connIndex=2 connection=59082e1d-3a4b-4c30-b95f-0f40fbdc454a event=0 ip=198.41.200.193 location=fco01 protocol=quic
2024-02-09T13:05:50Z INF Registered tunnel connection connIndex=3 connection=c38a7e8f-5b72-4a9b-b30b-2da9d2b1b8d7

event=0 ip=198.41.192.27 location=mxp03 protocol=quic

Hello, Is there any progress on how to fix this annoying problem.
Im banging my head for 3 days now and tried almost everything without any success.
This is what I get:
FATAL: Failed to create tunnel.
Please check the Cloudflare Zero Trust Dashboard for an existing tunnel with the name HomeAssistant_V2 and delete it:
Visit https://one.dash.cloudflare.com, then click on Access / Tunnels.

What I have tried:

  • Reinstalled cloudflared addon.
  • New domainname (examp.nl)
  • Deleted old homeassitant tunnel from cloudflare (under Network → Tunnel)

Any help is much appreciated.

hello

I’ve the same problem: impossible to activate my tunnel.
my config: I have two Green Box HA on 2 different domains. I want to configure both with cloudflare add-on

the first one is working perfectly

I’ve declared a second domain name on my cloudflare account. registred properly the cloudflare name servers in my registrar.
i installl cloudlfared add-on on my top new green bow HA, configure the domain and click on the url displayed on the logs. I selected properly the domain name on the new window to create the tunnel and the logs on my HA are the following:

-----------------------------------------------------------
 Add-on: Cloudflared
 Use a Cloudflare Tunnel to remotely connect to Home Assistant without opening any ports
-----------------------------------------------------------
 Add-on version: 5.1.15
 You are running the latest version of this add-on.
 System: Home Assistant OS 12.4  (aarch64 / green)
 Home Assistant Core: 2024.7.2
 Home Assistant Supervisor: 2024.06.2
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
[20:56:52] INFO: Checking add-on config...
[20:56:53] INFO: Checking for existing certificate...
[20:56:53] NOTICE: No certificate found
[20:56:53] INFO: Creating new certificate...
[20:56:53] NOTICE: 
[20:56:53] NOTICE: Please follow the Cloudflare Auth-Steps:
[20:56:53] NOTICE: 
Please open the following URL and log in with your Cloudflare account:

https://dash.cloudflare.com/argotunnel?aud=&callback=https%3A%2F%2Flogin.cloudflareaccess.org%2Fw4gr4Pn6gmQxxAQoYArYLktXgnpZyKJWW4s2VeamnGk%3D

Leave cloudflared running to download the cert automatically.
You have successfully logged in.
If you wish to copy your credentials to a server, they have been saved to:
/root/.cloudflared/cert.pem
[20:57:33] INFO: Authentication successfull, moving auth file to the '/data' folder
[20:57:33] INFO: Checking for existing certificate...
[20:57:33] INFO: Existing certificate found
[20:57:33] INFO: Checking for existing tunnel...
[20:57:33] NOTICE: No tunnel file found
[20:57:33] INFO: Creating new tunnel...
failed to create tunnel: Create Tunnel API call failed: tunnel with name already exists
[20:57:34] FATAL: Failed to create tunnel.
    Please check the Cloudflare Zero Trust Dashboard for an existing tunnel with the name homeassistant and delete it:
    Visit https://one.dash.cloudflare.com, then click on Access / Tunnels
s6-rc: warning: unable to start service init-cloudflared-config: command exited 1
/run/s6/basedir/scripts/rc.init: warning: s6-rc failed to properly bring all the services up! Check your logs (in /run/uncaught-logs/current if you have in-container logging) for more information.
/run/s6/basedir/scripts/rc.init: fatal: stopping the container.

I checked on cloudflare interface, I cannot see any created tunnel on ā€˜access’ webpage to try to delete it.

I see my first tunnel on zero-trust web interface. but I don’t see the second tunnel for second domain.

maybe the problem comes from the fact that the tunnel is named ā€œhomeassisstantā€ for the first GreenBox HA. and when I try to create the second instance, it uses the same name and does not work ???
any help ???

I answer myself: cloudflare does not accept two ā€œhomeassistantā€ tunnels with same name. We should use ā€œtunnel_nameā€ option in cloudflare add-on to change the default name…

Is there any news/any way how to change the tunnel name? I have two Homeassistant instances running and want both to use a cloudflared tunnel. The second one fails to create the tunnel.

Hey bro, I found a way. Go to Cloudflare Acess dashboard, manage your tunnels, click on the three dots of the current one, called homeassistant, click configure, do the migration, simply rename it. And that’s it. You can now have several HA’s