Existing tunnel error
dico opened this issue · 1 comments
Describe the bug
Get this error: 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
I don't have any tunnels with this name in my dashboard, but I already have another tunnel on another subdomain, to an Home Assistant installation in another location.
So this is an attempt to get a second Home Assistant (in another location / another IP) with another subdomain. Not sure if it's a limit for number of tunnels for each domain?
To Reproduce
Steps to reproduce the behavior:
- Completly new and fresh install of Home Assistant on an Odroid, without any other plugins, add-ons or similar.
- Install Cloudflare add-on.
- Add domain under configuration.
- Open URL in log for authorize and get a success message.
- Update log in add-on and see the error message.
Expected behavior
Not an error and a working tunnel.
Screenshots
If applicable, add screenshots to help explain your problem.
Add-On / Home Assistant Information:
-----------------------------------------------------------
Add-on: Cloudflared
Use a Cloudflare Tunnel to remotely connect to Home Assistant without opening any ports
-----------------------------------------------------------
Add-on version: 4.2.9
You are running the latest version of this add-on.
System: Home Assistant OS 11.0 (aarch64 / odroid-n2)
Home Assistant Core: 2023.10.3
Home Assistant Supervisor: 2023.10.0
-----------------------------------------------------------
Please, share the above information when looking for help
or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
[16:00:57] INFO: Checking add-on config...
[16:00:57] INFO: Checking for existing certificate...
[16:00:57] NOTICE: No certificate found
[16:00:57] INFO: Creating new certificate...
[16:00:57] NOTICE:
[16:00:57] NOTICE: Please follow the Cloudflare Auth-Steps:
[16:00:57] 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%2F-tF...
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
[16:01:12] INFO: Authentication successfull, moving auth file to the '/data' folder
[16:01:12] INFO: Checking for existing certificate...
[16:01:12] INFO: Existing certificate found
[16:01:12] INFO: Checking for existing tunnel...
[16:01:12] NOTICE: No tunnel file found
[16:01:12] INFO: Creating new tunnel...
failed to create tunnel: Create Tunnel API call failed: tunnel with name already exists
[16:01:13] 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 found a solution after some test and debugging. I will try to elaborate in case any others come across the same issue.
Under the Configuration-tab, it's a toggle "Show unused optional configuration options". When this is toggled, I can choose a "Cloudflare Tunnel Name". The tunnelname is available in Cloudflare's Zero Trust dashboard, and not the regular dashboard (not that I could find), that makes it some what confusing to find. I also had to add a credit card to get the Zero Trust dashboard, even though you can select a free-option.
By default this add-on creates a tunnel named "homeassistant" when the "Cloudflare Tunnel Name" is left blank.
When entering another tunnel name, it works as expected. The issue can be closed - but I would like to suggest some feature updates first :-)
- Is it possible to create a hint or something in the log for this error message?
- Maybe create a random tunnel name if field is left blank?