brenner-tobias / addon-cloudflared

Connect remotely to your Home Assistant instance without opening any ports using Cloudflared.
MIT License
821 stars 53 forks source link

400 Bad Request #674

Closed filmnight closed 2 months ago

filmnight commented 2 months ago

The problem

I have tried everything copy and pasting the info configuration.yaml into Studio Code server watched several YouTube video's to make sure i have done this correctly but still i get the 400: Bad Request PLEASE PLEASE can somone help me it says finnished setting up the Clouflare tunnel,connecting Clouflare tunnel,starting tunnel, etc but i still can't connect when i type https:// followed by my domane name

Add-on: Cloudflared Use a Cloudflare Tunnel to remotely connect to Home Assistant without opening any ports

Add-on version: 5.1.14 You are running the latest version of this add-on. System: Home Assistant OS 12.4 (aarch64 / yellow) Home Assistant Core: 2024.7.2 Home Assistant Supervisor: 2024.06.2 13:04:58] INFO: Checking add-on config... [13:04:58] INFO: Checking for existing certificate... [13:04:58] INFO: Existing certificate found [13:04:58] INFO: Checking for existing tunnel... [13:04:58] INFO: Existing tunnel with ID 93efce91-6609-4175-b199-a82a2ca449fb found [13:04:58] INFO: Checking if existing tunnel matches name given in config [13:04:59] INFO: Existing Cloudflare Tunnel name matches config, proceeding with existing tunnel file [13:04:59] INFO: Creating config file... [13:04:59] INFO: Validating config file... Validating rules from /tmp/config.json OK [13:04:59] INFO: Creating DNS entry mydomane.org... 2024-07-12T12:05:00Z INF mydomane.org is already configured to route to your tunnel tunnelID=93efce91-6609-4175-b199-a82a2ca449fb [13:05:00] INFO: Finished setting up the Cloudflare Tunnel [13:05:01] INFO: Connecting Cloudflare Tunnel... 2024-07-12T12:05:01Z INF Starting tunnel tunnelID=93efce91-6609-4175-b199-a82a2ca449fb 2024-07-12T12:05:01Z INF Version 2024.6.1 2024-07-12T12:05:01Z INF GOOS: linux, GOVersion: go1.22.2, GoArch: arm64 2024-07-12T12:05:01Z INF Settings: map[config:/tmp/config.json cred-file:/data/tunnel.json credentials-file:/data/tunnel.json metrics:0.0.0.0:36500 no-autoupdate:true origincert:/data/cert.pem] 2024-07-12T12:05:01Z INF Generated Connector ID: 71df1703-95e1-4a32-8cf5-6249595a5e32 2024-07-12T12:05:01Z INF Initial protocol quic 2024-07-12T12:05:01Z INF ICMP proxy will use 172.30.33.1 as source for IPv4 2024-07-12T12:05:01Z INF ICMP proxy will use ::1 in zone lo as source for IPv6 2024-07-12T12:05:01Z INF Starting metrics server on [::]:36500/metrics 2024-07-12T12:05:01Z INF Registered tunnel connection connIndex=0 connection=570fc9b1-fc3b-4703-baa8-856b4f337023 event=0 ip=198.41.200.33 location=lhr01 protocol=quic 2024-07-12T12:05:02Z INF Registered tunnel connection connIndex=1 connection=75d960c6-349d-4758-b4e0-a2ea1304be0d event=0 ip=198.41.192.167 location=lhr10 protocol=quic 2024-07-12T12:05:03Z INF Registered tunnel connection connIndex=2 connection=e500a7d7-0e36-4fcd-9025-05ff7eff8be6 event=0 ip=198.41.192.57 location=lhr09 protocol=quic 2024-07-12T12:05:04Z INF Registered tunnel connection connIndex=3 connection=876f85fc-7ab9-453c-80df-2e834bd6c49c event=0 ip=198.41.200.73 location=lhr13 protocol=qu

What version of Cloudflared has the issue?

5.1.14

What was the last working version of Cloudflared?

5.1.14

What type of installation are you running?

Home Assistant OS

Add-on YAML Configuration

default_config:
  http:
  use_x_forwarded_for: true
  trusted_proxies:
     172.30.33.0/24
# Load frontend themes from the themes folder
frontend:
  themes: !include_dir_merge_named themes

automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml

Anything in the logs that might be useful for us?

13:04:58] INFO: Checking add-on config...
[13:04:58] INFO: Checking for existing certificate...
[13:04:58] INFO: Existing certificate found
[13:04:58] INFO: Checking for existing tunnel...
[13:04:58] INFO: Existing tunnel with ID 93efce91-6609-4175-b199-a82a2ca449fb found
[13:04:58] INFO: Checking if existing tunnel matches name given in config
[13:04:59] INFO: Existing Cloudflare Tunnel name matches config, proceeding with existing tunnel file
[13:04:59] INFO: Creating config file...
[13:04:59] INFO: Validating config file...
Validating rules from /tmp/config.json
OK
[13:04:59] INFO: Creating DNS entry mydomane.org...
2024-07-12T12:05:00Z INF mydomane.org is already configured to route to your tunnel tunnelID=93efce91-6609-4175-b199-a82a2ca449fb
[13:05:00] INFO: Finished setting up the Cloudflare Tunnel
[13:05:01] INFO: Connecting Cloudflare Tunnel...
2024-07-12T12:05:01Z INF Starting tunnel tunnelID=93efce91-6609-4175-b199-a82a2ca449fb
2024-07-12T12:05:01Z INF Version 2024.6.1
2024-07-12T12:05:01Z INF GOOS: linux, GOVersion: go1.22.2, GoArch: arm64
2024-07-12T12:05:01Z INF Settings: map[config:/tmp/config.json cred-file:/data/tunnel.json credentials-file:/data/tunnel.json metrics:0.0.0.0:36500 no-autoupdate:true origincert:/data/cert.pem]
2024-07-12T12:05:01Z INF Generated Connector ID: 71df1703-95e1-4a32-8cf5-6249595a5e32
2024-07-12T12:05:01Z INF Initial protocol quic
2024-07-12T12:05:01Z INF ICMP proxy will use 172.30.33.1 as source for IPv4
2024-07-12T12:05:01Z INF ICMP proxy will use ::1 in zone lo as source for IPv6
2024-07-12T12:05:01Z INF Starting metrics server on [::]:36500/metrics
2024-07-12T12:05:01Z INF Registered tunnel connection connIndex=0 connection=570fc9b1-fc3b-4703-baa8-856b4f337023 event=0 ip=198.41.200.33 location=lhr01 protocol=quic
2024-07-12T12:05:02Z INF Registered tunnel connection connIndex=1 connection=75d960c6-349d-4758-b4e0-a2ea1304be0d event=0 ip=198.41.192.167 location=lhr10 protocol=quic
2024-07-12T12:05:03Z INF Registered tunnel connection connIndex=2 connection=e500a7d7-0e36-4fcd-9025-05ff7eff8be6 event=0 ip=198.41.192.57 location=lhr09 protocol=quic
2024-07-12T12:05:04Z INF Registered tunnel connection connIndex=3 connection=876f85fc-7ab9-453c-80df-2e834bd6c49c event=0 ip=198.41.200.73 location=lhr13 protocol=quic

Steps to reproduce the issue

it happens every time i try and login

Additional information

If i have come to the wrong place for help please don't tell me off just point me in the right direction to get the help i need i am going around in circles

elcajon commented 2 months ago

The indentation in your configuration.yaml is wrong, the following example should solve the problem (after a restart of HA Core).

default_config:
http:
  use_x_forwarded_for: true
  trusted_proxies:
    - 172.30.33.0/24
# Load frontend themes from the themes folder
frontend:
  themes: !include_dir_merge_named themes

automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
filmnight commented 2 months ago

Hi thank you very much for your help finally yes its done i can now access HA through my own domain