Hi, I’ve noticed recently that when attempting to access Home Assistant via internal or external IP it returns the common error “refused to connect”.
It has recently become more problematic without any obvious reason for it.
Temporary workaround
Power cycle
Hardware
Raspberry Pi 4 4Gb
Powered via PoE via PoE hat from Unifi 24 PoE switch
128Gb SSD used for storing Home Assistant
Has a static IP address
Home Assistant
Core Version: core-2021.11.5
Supervisor Version: supervisor-2021.10.8
OS: Home Assistant OS 6.6
Deployment: production
Python version: 3…7
Integrations
Alexa
CO2 Signal
ESPHome
HACS
Mobile App
Mosquito broker
Tasmota
WLED
Addons (all running latest version)
Duck DNS
ESPHome
Home Assistant Google Drive Backup
Mosquitto broker
Samba share
Studio Code Server
Terminal & SSH
Logs
Core
2021-12-04 10:07:52 ERROR (SyncWorker_19) [homeassistant.components.google.calendar] Unable to connect to Google
2021-12-04 10:07:57 ERROR (SyncWorker_41) [homeassistant.components.google.calendar] Unable to connect to Google
2021-12-04 10:08:02 ERROR (SyncWorker_38) [homeassistant.components.google.calendar] Unable to connect to Google
2021-12-04 10:08:07 ERROR (SyncWorker_53) [homeassistant.components.google.calendar] Unable to connect to Google
2021-12-04 10:16:21 WARNING (MainThread) [homeassistant.components.unifi] Lost connection to UniFi controller
2021-12-04 10:23:52 ERROR (SyncWorker_59) [homeassistant.components.google.calendar] Unable to connect to Google
2021-12-04 10:23:57 ERROR (SyncWorker_22) [homeassistant.components.google.calendar] Unable to connect to Google
2021-12-04 10:24:02 ERROR (SyncWorker_20) [homeassistant.components.google.calendar] Unable to connect to Google
2021-12-04 10:24:07 ERROR (SyncWorker_62) [homeassistant.components.google.calendar] Unable to connect to Google
2021-12-04 10:27:00 ERROR (MainThread) [alexapy.alexaapi] Giving up _static_request(...) after 5 tries (alexapy.aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host alexa.amazon.co.uk:443 ssl:<ssl.SSLContext object at 0x7f842bd3c0> [Try again])
2021-12-04 10:27:00 WARNING (MainThread) [alexapy.helpers] alexaapi.get_dnd_state((<alexapy.alexalogin.AlexaLogin object at 0x7f845164c0>,), {}): A connection error occured: An exception of type ClientConnectorError occurred. Arguments:
(ConnectionKey(host='alexa.amazon.co.uk', port=443, is_ssl=True, ssl=<ssl.SSLContext object at 0x7f842bd3c0>, proxy=None, proxy_auth=None, proxy_headers_hash=3842574276470763602), gaierror(-3, 'Try again'))
2021-12-04 10:27:00 ERROR (MainThread) [alexapy.alexaapi] Giving up _static_request(...) after 5 tries (alexapy.aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host alexa.amazon.co.uk:443 ssl:<ssl.SSLContext object at 0x7f842bd3c0> [Try again])
2021-12-04 10:27:00 WARNING (MainThread) [alexapy.helpers] alexaapi.get_device_preferences((<alexapy.alexalogin.AlexaLogin object at 0x7f845164c0>,), {}): A connection error occured: An exception of type ClientConnectorError occurred. Arguments:
(ConnectionKey(host='alexa.amazon.co.uk', port=443, is_ssl=True, ssl=<ssl.SSLContext object at 0x7f842bd3c0>, proxy=None, proxy_auth=None, proxy_headers_hash=3842574276470763602), gaierror(-3, 'Try again'))
2021-12-04 10:27:00 ERROR (MainThread) [alexapy.alexaapi] Giving up _static_request(...) after 5 tries (alexapy.aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host alexa.amazon.co.uk:443 ssl:<ssl.SSLContext object at 0x7f842bd3c0> [Try again])
2021-12-04 10:27:00 WARNING (MainThread) [alexapy.helpers] alexaapi.get_bluetooth((<alexapy.alexalogin.AlexaLogin object at 0x7f845164c0>,), {}): A connection error occured: An exception of type ClientConnectorError occurred. Arguments:
(ConnectionKey(host='alexa.amazon.co.uk', port=443, is_ssl=True, ssl=<ssl.SSLContext object at 0x7f842bd3c0>, proxy=None, proxy_auth=None, proxy_headers_hash=3842574276470763602), gaierror(-3, 'Try again'))
2021-12-04 10:27:00 ERROR (MainThread) [custom_components.alexa_media] Error fetching alexa_media data: Error communicating with API:
2021-12-04 10:27:06 ERROR (MainThread) [alexapy.alexaapi] Giving up _static_request(...) after 5 tries (alexapy.aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host alexa.amazon.co.uk:443 ssl:<ssl.SSLContext object at 0x7f842bd3c0> [Try again])
2021-12-04 10:27:06 WARNING (MainThread) [alexapy.helpers] alexaapi.get_devices((<alexapy.alexalogin.AlexaLogin object at 0x7f845164c0>,), {}): A connection error occured: An exception of type ClientConnectorError occurred. Arguments:
(ConnectionKey(host='alexa.amazon.co.uk', port=443, is_ssl=True, ssl=<ssl.SSLContext object at 0x7f842bd3c0>, proxy=None, proxy_auth=None, proxy_headers_hash=3842574276470763602), gaierror(-3, 'Try again'))
2021-12-04 10:31:05 ERROR (SyncWorker_51) [homeassistant.components.co2signal] Unexpected exception
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/urllib3/connection.py", line 174, in _new_conn
conn = connection.create_connection(
File "/usr/local/lib/python3.9/site-packages/urllib3/util/connection.py", line 73, in create_connection
for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
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
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py", line 699, in urlopen
httplib_response = self._make_request(
File "/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py", line 382, in _make_request
self._validate_conn(conn)
File "/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py", line 1010, in _validate_conn
conn.connect()
File "/usr/local/lib/python3.9/site-packages/urllib3/connection.py", line 358, in connect
conn = self._new_conn()
File "/usr/local/lib/python3.9/site-packages/urllib3/connection.py", line 186, in _new_conn
raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x7f633b8ca0>: Failed to establish a new connection: [Errno -3] Try again
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/requests/adapters.py", line 439, in send
resp = conn.urlopen(
File "/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py", line 755, in urlopen
retries = retries.increment(
File "/usr/local/lib/python3.9/site-packages/urllib3/util/retry.py", line 574, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='api.co2signal.com', port=443): Max retries exceeded with url: /v1/latest?lon=-6.421350538730621&lat=54.420568623488926 (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f633b8ca0>: Failed to establish a new connection: [Errno -3] Try again'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/co2signal/__init__.py", line 119, in get_data
data = CO2Signal.get_latest(
File "/usr/local/lib/python3.9/site-packages/CO2Signal/co2signal.py", line 34, in get_latest
latest_data = (requests
File "/usr/local/lib/python3.9/site-packages/requests/api.py", line 75, in get
return request('get', url, params=params, **kwargs)
File "/usr/local/lib/python3.9/site-packages/requests/api.py", line 61, in request
return session.request(method=method, url=url, **kwargs)
File "/usr/local/lib/python3.9/site-packages/requests/sessions.py", line 542, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python3.9/site-packages/requests/sessions.py", line 655, in send
r = adapter.send(request, **kwargs)
File "/usr/local/lib/python3.9/site-packages/requests/adapters.py", line 516, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='api.co2signal.com', port=443): Max retries exceeded with url: /v1/latest?lon=-6.421350538730621&lat=54.420568623488926 (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f633b8ca0>: Failed to establish a new connection: [Errno -3] Try again'))
2021-12-04 10:31:05 ERROR (MainThread) [homeassistant.components.co2signal] Error fetching co2signal data:
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] done.
[services.d] starting services
[services.d] done.
2021-12-09 13:21:48 WARNING (SyncWorker_1) [homeassistant.loader] We found a custom integration hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2021-12-09 13:21:48 WARNING (SyncWorker_2) [homeassistant.loader] We found a custom integration google_keep which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2021-12-09 13:21:48 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration alexa_media which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2021-12-09 13:21:49 WARNING (Recorder) [homeassistant.components.recorder.util] The system could not validate that the sqlite3 database at //config/home-assistant_v2.db was shutdown cleanly
2021-12-09 13:21:49 WARNING (Recorder) [homeassistant.components.recorder.util] Ended unfinished session (id=193 from 2021-12-07 14:33:42.564818)
2021-12-09 13:21:52 WARNING (MainThread) [homeassistant.components.webhook] Received message for unregistered webhook 508e90729b07cbaf840007dd1684567b62424b2db68437a7a8d860fc600e0c64 from 10.0.10.1
2021-12-09 13:21:52 WARNING (MainThread) [homeassistant.components.webhook] Received message for unregistered webhook 508e90729b07cbaf840007dd1684567b62424b2db68437a7a8d860fc600e0c64 from 10.0.10.1
2021-12-09 13:21:52 WARNING (MainThread) [homeassistant.components.webhook] Received message for unregistered webhook 508e90729b07cbaf840007dd1684567b62424b2db68437a7a8d860fc600e0c64 from 10.0.10.1
2021-12-09 13:22:23 WARNING (MainThread) [alexapy.alexawebsocket] mac_dms not detected; websocket likely won't connect
2021-12-09 13:22:40 WARNING (MainThread) [aioesphomeapi.reconnect_logic] Can't connect to ESPHome API for 10.0.30.107 @ 10.0.30.107: Error connecting to ('10.0.30.107', 6053): [Errno 113] Connect call failed ('10.0.30.107', 6053)
2021-12-09 13:22:45 WARNING (MainThread) [homeassistant.components.calendar] Setup of calendar platform google is taking over 10 seconds.
2021-12-09 13:22:49 WARNING (MainThread) [homeassistant.config_entries] Config entry 'christmas-tree' for wled integration not ready yet: Invalid response from API: Error occurred while communicating with WLED device at 10.0.30.21; Retrying in background
2021-12-09 13:22:51 WARNING (MainThread) [homeassistant.config_entries] Config entry 'Picture Frame - Right' for wled integration not ready yet: Invalid response from API: Timeout occurred while connecting to WLED device at 10.0.30.115; Retrying in background
2021-12-09 13:22:52 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: wled
2021-12-09 13:22:57 WARNING (MainThread) [homeassistant.config_entries] Config entry 'Picture Frame - Left' for wled integration not ready yet: Invalid response from API: Error occurred while communicating with WLED device at 10.0.30.188; Retrying in background