Cannot connect to host error 443 for importing blueprints or adding integrations

Hi,
i am new to homeassistant and I am running into a lot of problems with adding integrations and blueprints. This seems to some kind of networking issue.
Whenever i try to add a new blueprint from the community I get an “unknown error”.

This is the Log:

Logger: homeassistant.components.websocket_api.http.connection
Source: components/blueprint/importer.py:155
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 13:17:48 (2 occurrences)
Last logged: 13:36:16


Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 1155, in _create_direct_connection
    hosts = await asyncio.shield(host_resolved)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 874, in _resolve_host
    addrs = await self._resolver.resolve(host, port, family=self._family)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/resolver.py", line 33, in resolve
    infos = await self._loop.getaddrinfo(
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/asyncio/base_events.py", line 867, in getaddrinfo
    return await self.run_in_executor(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/socket.py", line 962, 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 "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 26, in _handle_async_response
    await func(hass, connection, msg)
  File "/usr/src/homeassistant/homeassistant/components/blueprint/websocket_api.py", line 76, in ws_import_blueprint
    imported_blueprint = await importer.fetch_blueprint_from_url(hass, msg["url"])
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/blueprint/importer.py", line 257, in fetch_blueprint_from_url
    imported_bp = await func(hass, url)
                  ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/blueprint/importer.py", line 155, in fetch_blueprint_from_community_post
    resp = await session.get(import_url, raise_for_status=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/client.py", line 536, in _request
    conn = await self._connector.connect(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 540, in connect
    proto = await self._create_connection(req, traces, timeout)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 901, in _create_connection
    _, proto = await self._create_direct_connection(req, traces, timeout)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 1169, in _create_direct_connection
    raise ClientConnectorError(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host community.home-assistant.io:443 ssl:default [Try again]

Similar logs are created when for example trying to add the Roborock Integration.

I already spent many hours in google however I can not find a solution so far. Any help would be much appreciated.

Seems your system cannot find the path to the websockets API; most likely hostname resolution issue, pointing to DNS/mDNS issues. Can you access the HA system over your LAN from another PC. Can you ping the HA hostname (e.g. ping homeassistant.local).

Hi and thank you,
I was also looking in similar directions but I am far away from being an expert in networking details.
Pinging it from my local pc works fine:

Ping wird ausgeführt für homeassistant.local [192.168.178.171] mit 32 Bytes Daten:
Antwort von 192.168.178.171: Bytes=32 Zeit=6ms TTL=64
Antwort von 192.168.178.171: Bytes=32 Zeit=6ms TTL=64
Antwort von 192.168.178.171: Bytes=32 Zeit=6ms TTL=64
Antwort von 192.168.178.171: Bytes=32 Zeit=10ms TTL=64

Ping-Statistik für 192.168.178.171:
    Pakete: Gesendet = 4, Empfangen = 4, Verloren = 0
    (0% Verlust),
Ca. Zeitangaben in Millisek.:
    Minimum = 6ms, Maximum = 10ms, Mittelwert = 7ms

sorry for the german, don’t know how to change that but in general it means ping successfull

Interestingly if I try to do that ping on the home assistant machine via ssh it returns “bad address” but i also do not know if it should be able to ping itself. I also can not ping any web address

I can read German no issue at all. It does not seem a DNS related issue. If you are running a firewall can you disable it while testing and see if the issue persists.

Unfortunately there is no special firewall running.
I thought about a dns resolver issue.

but i can not find the issue here:

Do you have any more ideas what else I can try? this is really frustrating me

try to http the websocket api from a web browser.

http://ha-ipv4:8123/api/websocket

If it works you should get a response:

image

Additionally, check your configuration.yaml and try to see it something is not right in the http: section. I suggest to revert http: to its default settings to see it this fixes the issue and also search for explicit reference to websocket_api: and if there is comment it out. Reboot HA and see if problem is solved.

Read Home Assistant WebSocket API - Home Assistant

Hello,

I have this errror since i update to 2023.9.1

[https connection impossible (ERR_SSL_PROTOCOL_ERROR) · Issue #100231 · home-assistant/core · GitHub]