Bad Gateway. 502 Error Code #374
-
The problemI've tried local IP, hostname (homeassistant and hassio) as service IP. What version of Cloudflared has the issue?4.1.1 What was the last working version of Cloudflared?No response What type of installation are you running?Home Assistant OS Add-on YAML Configurationexternal_hostname: homeassistant.***
additional_hosts:
- hostname: plex.***
service: https://10.1.1.114:32400
- hostname: bitwarden.***
service: https://10.1.1.114:7277
tunnel_name: personal-homelab
log_level: debug
tunnel_token: ********* Anything in the logs that might be useful for us?HomeAssistant Logs:
2023-04-13 13:35:27.500 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 332, in data_received
messages, upgraded, tail = self._request_parser.feed_data(data)
File "aiohttp/_http_parser.pyx", line 551, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: 400, message="Bad status line 'Invalid method encountered'"
Addon Logs:
2023-04-13T11:38:03Z ERR error="Unable to reach the origin service. The service may be down or it may not be responding to traffic from cloudflared: tls: first record does not look like a TLS handshake" cfRay=7b736ba8d88191e4-FRA ingressRule=0 originService=https://10.1.1.114:8123
2023-04-13T11:38:03Z ERR Request failed error="Unable to reach the origin service. The service may be down or it may not be responding to traffic from cloudflared: tls: first record does not look like a TLS handshake" connIndex=0 dest=https://homeassistant.*****/favicon.ico ip=198.41.192.67 type=http Steps to reproduce the issueJust follow the documentation Additional informationservices stored in additional_hosts works fine |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
There are a few things that stand out about your configuration that can lead to a problem.
In general, I would recommend reading the information in the add-on for the documentation of the local managed tunnel as well as the information on the remote managed tunnel and deciding on one of the two. |
Beta Was this translation helpful? Give feedback.
-
Since it is not a bug, I am moving the issue to the discussions. |
Beta Was this translation helpful? Give feedback.
-
OK. So I've done all your steps and works now. I moved to remote configuration, added additional proxy address and switched https to http in home assistant public hostname. Thanks for help |
Beta Was this translation helpful? Give feedback.
There are a few things that stand out about your configuration that can lead to a problem.
tunnel_token
which is used for a remote managed tunnel and causes all other configuration options to be ignored. So you should first consider which type of connection you want to use. Take a look here.