t0mer / ims-custom-component

The Israel Meteorological Service (IMS) integration component for home assistant
MIT License
35 stars 8 forks source link

Failed to install intergration #87

Closed AryehGielchinsky closed 2 months ago

AryehGielchinsky commented 3 months ago

I found the integration, but when I attempt to add it to HA it fails with error Config flow could not be loaded: <html> <head><title>504 Gateway Time-out</title></head> <body> <center><h1>504 Gateway Time-out</h1></center> <hr><center>openresty</center> </body> </html>

I can load https://ims.gov.il/en/forecast_data/2 on my laptop in about 1 second, but from my server running HA (Raspberry PI 4 plugged in over Ethernet on same network) I get the following timeout followed by a download completion:

test # time wget https://ims.gov.il/en/forecast_data/2
--2024-03-24 21:12:32--  https://ims.gov.il/en/forecast_data/2
Resolving ims.gov.il (ims.gov.il)... 2001:678:a3c:1100::53, 147.237.2.161
Connecting to ims.gov.il (ims.gov.il)|2001:678:a3c:1100::53|:443... failed: Operation timed out.
Connecting to ims.gov.il (ims.gov.il)|147.237.2.161|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [application/json]
Saving to: '2'

2            [ <=>      ]   6.41K  --.-KB/s    in 0s      

2024-03-24 21:14:42 (13.1 MB/s) - '2' saved [6567]

real    2m10.684s
user    0m0.080s
sys 0m0.024s

WGET to other websites on my pi is much faster. WGET from my laptop is similarly slow.

It appears that this might be an issue with IMS or my network, and not an issue with this integration, but thought I'd check here.

GuyKh commented 3 months ago

It indeed looks like an issue with IMS or a combination of that and your ISP. Do you have a custom DNS or a DNS Blocker (i.e. Pi-Hole / AdGuardHome) - either way, did you try to modify it? It seems that connections to IPv6 time out on your part - while IPv4 work somehow OK. I'd look for some settings in your router and maybe disabling IPv6 for a while and testing it. Also consider disabling IPv6 in the RaspberryPi

AryehGielchinsky commented 2 months ago

I have an adblocker (Openwrt with adblock package and a few lists), but turning it off didn't help.

I think you are correct that it may b related to IPv6. I created a new ubuntu instance in vultr in Tel Aviv, and it looks like I'm having the same ivp6 issue there.

root@checkipv6:~/test# time wget -4 ims.gov.il/en/forecast_data/2
--2024-04-04 12:57:37--  http://ims.gov.il/en/forecast_data/2
Resolving ims.gov.il (ims.gov.il)... 147.237.2.161
Connecting to ims.gov.il (ims.gov.il)|147.237.2.161|:80... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: https://ims.gov.il/en/forecast_data/2 [following]
--2024-04-04 12:57:37--  https://ims.gov.il/en/forecast_data/2
Connecting to ims.gov.il (ims.gov.il)|147.237.2.161|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [application/json]
Saving to: ‘2’

2                                                                        [ <=>                                                                                                                                                                  ]   6.65K  --.-KB/s    in 0.003s  

2024-04-04 12:57:37 (2.23 MB/s) - ‘2’ saved [6805]

real    0m0.279s
user    0m0.004s
sys     0m0.004s
root@checkipv6:~/test# rm 2
root@checkipv6:~/test# time wget -6 ims.gov.il/en/forecast_data/2
--2024-04-04 12:57:48--  http://ims.gov.il/en/forecast_data/2
Resolving ims.gov.il (ims.gov.il)... 2001:678:a3c:1100::53
Connecting to ims.gov.il (ims.gov.il)|2001:678:a3c:1100::53|:80... ^C

real    0m20.777s
user    0m0.002s
sys     0m0.000s

Would you be able to run the following two commands from your network that has this integration running on it? time wget -4 ims.gov.il/en/forecast_data/2 time wget -6 ims.gov.il/en/forecast_data/2

AryehGielchinsky commented 2 months ago

Interesting, I retired installing the integration and it works now. The only thing I can think of that I changed was adding DNS over HTTPS to my router, though I'm not sure if that would do anything. wget -6 ims.gov.il/en/forecast_data/2 still times out.