Closed dwahdany closed 1 year ago
Your add-on and HA configurations look fine, also the logs of Cloudflare look good. Just to make sure that you have done nothing wrong with setting-up the remote tunnel, I suggest that you set-up the local tunnel again and follow the instructions, without introducing any additional_hosts or other options. So really just setting the tunnel name to something new and entering your (sub)domain that you are managing in Cloudflare.
Also: Are you using a domain from Freenom?
Thanks for the response, I've tried setting up everything again, but I get the same error. I didn't comment again, since I'm currently figuring out whether this is even related to your addon. Manually exposing :80
works. Using nginx-proxy-manager breaks, resulting in the same error.
To answer your question, the domain is a paid TLD.
Edit: Enabling websocket support in nginx-proxy-manager fixes the manually exposed port and allows for SSL remote access.
Current status:
The issue seems to be that during login a websocket connection fails:
wss://<domain>/api/websocket
I guess that results in an invalid access token and all consecutive failures. This is the same error I observed when using nginx-proxy-manager without websocket support.
Can you let me know where NPM is used in you set-up? I suggest that you set everything up without any additional hosts or NPM or anything to test the tunnel connection with only HA exposed. Then you can move from there to see whats going on. So very simply close all ports on your router, delete all DNS records related to HA from Cloudflare. Configure the add-on with any subdomain you want to use, start it, open the logs and copy the link to authenticate with Cloudflare, wait for a couple of minutes and check the URL
I'm afraid that I'm getting exactly the same error on a fresh install (HAOS on Proxmox), without NGINX proxy manager set up. I can access home assistant at https://homeassistant.local:8123
, but not using my subdomain. The domain is hosted with cloudflare and works as expected.
For what it's worth, I had this exact problem when I tried setting up HA with docker compose in linux and figured it was an issue with how I set it up, but I don't think it is any more. At times, it also returned the same error as #263 when I first installed the add-on (as well as the container setup), in both Safari and Chrome browsers.
My add-on logs below.
-----------------------------------------------------------
Add-on: Cloudflared
Use a Cloudflare Tunnel to remotely connect to Home Assistant without opening any ports
-----------------------------------------------------------
Add-on version: 4.0.8
You are running the latest version of this add-on.
System: Home Assistant OS 9.4 (amd64 / qemux86-64)
Home Assistant Core: 2023.1.7
Home Assistant Supervisor: 2022.12.1
-----------------------------------------------------------
Please, share the above information when looking for help
or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
[00:40:19] INFO: Checking add-on config...
[00:40:20] INFO: Checking for existing certificate...
[00:40:20] INFO: Existing certificate found
[00:40:20] INFO: Checking for existing tunnel...
[00:40:20] INFO: Existing tunnel with ID x found
[00:40:20] INFO: Checking if existing tunnel matches name given in config
[00:40:20] INFO: Existing Cloudflare Tunnel name matches config, proceeding with existing tunnel file
[00:40:20] INFO: Creating config file...
[00:40:21] INFO: Validating config file...
Validating rules from /tmp/config.json
OK
[00:40:21] INFO: Creating DNS entry sub.domain.com...
2023-01-24T05:40:22Z INF sub.domain.com is already configured to route to your tunnel tunnelID=x
[00:40:22] INFO: Finished setting up the Cloudflare Tunnel
[00:40:22] INFO: Connecting Cloudflare Tunnel...
2023-01-24T05:40:22Z INF Starting tunnel tunnelID=x
2023-01-24T05:40:22Z INF Version 2023.1.0
2023-01-24T05:40:22Z INF GOOS: linux, GOVersion: go1.19.3, GoArch: amd64
2023-01-24T05:40:22Z 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]
2023-01-24T05:40:22Z INF Generated Connector ID: x
2023-01-24T05:40:22Z INF Initial protocol quic
2023-01-24T05:40:22Z INF ICMP proxy will use 172.30.33.0 as source for IPv4
2023-01-24T05:40:22Z INF ICMP proxy will use :: as source for IPv6
2023-01-24T05:40:22Z INF Starting metrics server on [::]:36500/metrics
2023-01-24T05:40:23Z INF Connection x registered with protocol: quic connIndex=0 ip=x location=IAD
2023-01-24T05:40:23Z INF Connection x registered with protocol: quic connIndex=1 ip=x location=ORD
2023-01-24T05:40:24Z INF Connection x registered with protocol: quic connIndex=2 ip=x location=IAD
2023-01-24T05:40:25Z INF Connection x registered with protocol: quic connIndex=3 ip=1x location=ORD
I assume this is an issue with your set-up on a VM, in a docker client. I am sorry but I cannot replicate that. Kindly let me know if you have any additional information / ideas that might help.
I'm not sure why, but after uninstalling and reinstalling the local tunnel, everything seems to be working. Safari can't find the server, but Chrome can so that's OK.
I think there might have been some interference with NGINX proxy manager because even though I completely remove the linux OS I was using for the docker setup (it was running bare-metal, not within a VM) and replaced the whole SSD with the Proxmox installation so I could try HAOS on a VM, I'm still able to access the NGINX welcome pages. I have no idea how that's happening as my understanding is that is should only persist as long as the docker containers, but I'm very new to NGINX so possibly interpreting this incorrectly. Sorry I couldn't be more help.
There hasn't been any activity on this issue recently, so we clean up some of the older and inactive issues. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thanks!
The problem
I've (hopefully) setup everything according to instructions, tried both automatic and manual tunnel, even changed the tunnel service to 'localhost:8123' but to no avail:
I can open
https://<domain>
in my browser and see the login screen. Upon entering credentials, I see "Unable to connect, retrying in ...". Pressing retry now doesn't help, I can't get past the login. The only problem in the browser I can identitfy is a HTTP 400:which returns
{"error":"invalid_request","error_description":"Invalid code"}
Entering wrong credentials fails the login, so some communcation is happening.What version of Cloudflared has the issue?
4.0.8
What was the last working version of Cloudflared?
No response
What type of installation are you running?
Home Assistant OS
Add-on YAML Configuration
Anything in the logs that might be useful for us?
Steps to reproduce the issue
Hassio Config
Hassio Logs
Hassio shows failed login attemps, where
<myIPV6>
is my public IPv6 address.