I don’t have port forwarding, but I do have nginx as proxy. Either way it should not be an issue, as it should not matter as it’s hass trying to access the outside world, not the other way around.
I mean - You don’t need to port-forward all your devices in your home behind a router to browse internet, right?
Yes, of course it does Even more, on machine that’s running HASS I can also curl that link without any problems.
Here’s what is says in logs
Error fetching data: <PreparedRequest [GET]> from http://ip.jsontest.com/ failed with HTTPConnectionPool(host='ip.jsontest.com', port=80): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f1c629fb940>: Failed to establish a new connection: [Errno -3] Try again',))
And tried to ping google.com. That did not work.
Then I tried to ping one of google’s IPs directly, and it worked.
So this likely tells that there’s some error with DNS stuff in docker.
Did not help, namely - editing the /etc/docker/daemon.json file
I managed to make it work inside my local network, though, and by using direct IPs, but that won’t work for all services, especially not Google Assistant integration.
This overwrites contents of the resolv.conf file, setting up google’s DNS server. Now DNS works, and I can even use it’s package manager.
I’m not sure, however, if these changes are permanent, or if anything I do inside a container is completely overwritten whenever I update to a new hass version? I suspect it’s the latter.
Maybe it will be useful for someone. Replace IP with your DNS, 192.168.1.1 is my router. You can use 1.1.1.1 or 8.8.8.8 for CloudFlare’s or Google’s DNS. Also homeassistant is the name of the docker container, adjust if needed.