[help] Since 2022.5 Ha core, cannot get almost anything from outside internet

Hi all.

After upgrade to 2022.5 version my setup ran into problem ,that looks like hassos cannot reach internet.
First symptom was that HACS very often had:

Background tasks pending
Some repositories might not show until this is completed

Ignored that, after restart this warning dissapeared. Then when I tried to update addons from HACS they did not update any more, and in logs were this:

Download failed - Cannot connect to host objects.githubusercontent.com:443 ssl:default [Try again]

Request exception for 'https://api.github.com/rate_limit' with - Cannot connect to host api.github.com:443 ssl:default [Try again]

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 1154, in _create_direct_connection
    hosts = await asyncio.shield(host_resolved)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 880, in _resolve_host
    addrs = await self._resolver.resolve(host, port, family=self._family)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/resolver.py", line 33, in resolve
    infos = await self._loop.getaddrinfo(
  File "/usr/local/lib/python3.9/asyncio/base_events.py", line 856, in getaddrinfo
    return await self.run_in_executor(
  File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.9/socket.py", line 954, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -3] Try again

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/config/custom_components/hacs/base.py", line 605, in async_download_file
  File "/usr/local/lib/python3.9/site-packages/aiohttp/client.py", line 535, in _request
    conn = await self._connector.connect(
  File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 542, in connect
    proto = await self._create_connection(req, traces, timeout)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 907, in _create_connection
    _, proto = await self._create_direct_connection(req, traces, timeout)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 1166, in _create_direct_connection
    raise ClientConnectorError(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host objects.githubusercontent.com:443 ssl:default [Try again]

But on HA core startup, when HACS has started, it successfully scans for updates, and offer them for install.

Also realized my command line sensors stopped working, like:

  - platform: rest  
    resource: http://icanhazip.com
    name: external_ip
    value_template: '{{ value }}'
    scan_interval: 3600

gives me error:
Error fetching data: http://icanhazip.com failed with [Errno -3] Try again

Also find out that System Health shows me unreachable endpoints:

Home Assistant Community Store

GitHub API ok
GitHub Content unreachable
GitHub Web unreachable – more info
GitHub API Calls Remaining 5000

Home Assistant Cloud

Logged In false
Reach Certificate Server unreachable
Reach Authentication Server unreachable
Reach Home Assistant Cloud ok

Home Assistant Supervisor

Version API unreachable

Spotify

Spotify API endpoint reachable unreachable

Spotify

Spotify API endpoint reachable unreachable

ha dns info gives me:

fallback: true
host: 172.30.32.3
llmnr: true
locals:
- dns://8.8.8.8
- dns://1.1.1.1
mdns: true
servers: []
update_available: false
version: 2022.04.1
version_latest: 2022.04.1

Intersting part that, when I ping gihub.com via hassio terminal it gives me bad address, when I ping githubs IP it pings, and afterwards I can ping host github.com

ping github.com -c 5
ping: bad address 'github.com'

ping:140.82.121.4 -c -5
PING 140.82.121.4 (140.82.121.4): 56 data bytes
64 bytes from 140.82.121.4: seq=0 ttl=54 time 31.832 ms

ping github.com -c 5
PING 140.82.121.3 (140.82.121.3): 56 data bytes
64 bytes from 140.82.121.4: seq=0 ttl=54 time 31.832 ms

Also tried to set IP static not dhcp( with reservation), Rebooted/upgraded Mikrotik router, restarted Hassos Host (now v7.6), had instlalled adblock guard addon (but it was disabled all the time) removed it.

I have run out of Ideas it it all is really weird. I have not set up any ACLs in my netowork, and with this network setup my HA Core has ran for 4 years without any problems till now.

Installed test HA Core instance on Hyper V, upgraded it to latest HA Core and on this machine there is no such a issue.

PLease help me to resolve this strange issue, as it is driving me nuts :slight_smile:

about page:

Home Assistant Core 2022.5.5
Home Assistant Supervisor 2022.05.3
Home Assistant OS 7.6
Kernel version 5.10.103-v8
Agent version 1.2.1

Time is correct on Homeasistant Core

is this resolv.conf correct?

cat /etc/resolv.conf
search local.hass.io
nameserver 172.30.32.3

Few years ago I had pi-Hole installed on the same RPi. But it was removed. Maybe some traces left somewhere…

also addons like google backup are working, backups are syncing to google drive.
Hassio analytics and spotify also is not working. Neither are scrape sensors.

Error sending analytics to https://analytics-api.home-assistant.io/v1: ClientConnectorError(ConnectionKey(host='analytics-api.home-assistant.io', port=443, is_ssl=True, ssl=None, proxy=None, proxy_auth=None, proxy_headers_hash=8655268238337008703), gaierror(-3, 'Try again'))

Error requesting XX Devices data: Cannot connect to host accounts.spotify.com:443 ssl:default [Try again]

I just dont get it :woozy_face: It definetly looks like DNS issue :slight_smile: but its kinda fine with DNS

nslookup
server 8.8.8.8
github.com

returns correct address

[kind of solved]
Really strange, tho. Till now my DNS list was
8.8.8.8
1.1.1.1
and all the time the 8.8.8.8 was used as it was first. And I did all my tests only with google dns.

Now I tested only with cloudflare DNS, and all my issues are gone. Everything updated, and HA core health is showing up good. Looks like something fishy with google dns. :woozy_face:

1 Like