home-assistant / iOS

:iphone: Home Assistant for Apple platforms
https://companion.home-assistant.io
Other
1.59k stars 311 forks source link

HassApp fails with "Timeout while looking up redirect_uri https://www.hassapp.com" #2161

Open FWinkler79 opened 2 years ago

FWinkler79 commented 2 years ago

iOS device model, version and app version

Model Name: iPhone 13 Pro Software Version: iOS 15.5 App version: HassApp 1.7.3

Home Assistant Core Version

2022.7.6

Describe the bug

Sorry, if this is not the right repository, but I have found no other way to contact the author of HassApp, and I hope you know him.

I am struggeling with getting the HassApp connected to my home assistant. Everything is set up correctly, and I can run the Home Assistant companion app without problems. But when I try to connect HassApp (at initial setup of the app) with Home Assistant server, I always get the following error:

Notice that the resolution of www.hassapp.com is failing.

I run Home Assistant with a domain name that is registered with duckdns.org. Certs are fine, and I use IPv6 addresses to expose the home assistant server to the outside world via my ISP (Vodafone).

Since I run Home Assistant from Docker, I opened a shell inside the container and checked if I can resolve www.hassapp.com to makes sure it's not a DNS issue as described here. In fact, I can resolve the name, and I can even curl it and get a page back.

However, when I try to curl the page using IPv6 like so: curl -v6 https://www.hassapp.com ... it fails. It keeps showing * Trying 2001:41d0:302:2200::ce5:443... and then times out.

Looked up the IPv6 address of https://www.hassapp.com online (via one of those lookup pages) and it yields the same IPv6 address, however that does not seem to be resolvable. I also tried to ping the IPv6 address from my ISP's home gateway. No luck there either.

So my guess is: the IPv6 DNS entry pointing to https://www.hassapp.com is wrong. Probably the box running that server has a different IPv6 address, and wherever this address is DNS-managed, an old entry is still maintained. I have the same issue every now and then, when my ISP assigns a new IPv6 address to my Hass server, and I usually have to update my duckdns.org entries then.

Could you please relay this message to the Author of HassApp and ask him to fix this problem? Basically it may boil down to making sure the IPv6 address in DNS is correct.

Thanks.

To Reproduce

Expected behavior

Connection should succeed and OAuth token should be retrieved by application.

Screenshots

IMG_4515

Additional context

N/A

bitboxer commented 1 year ago

I have the same error

bitboxer commented 1 year ago

I found the place to report bugs btw: https://bitbucket.org/kikettas/hassapp/issues/46/login-failed-because-ipv6-of-wwwhassappcom

The issue can be solved by adding this line to the /etc/hosts file:

217.182.170.31  www.hassapp.com

This will force the server to use a IPv4 address for the hassapp.com server.