home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
74.13k stars 31.11k forks source link

APCUPSd unables to reinitialize after network recovery #41887

Closed epiniguin closed 3 years ago

epiniguin commented 4 years ago

The problem

In my environment HA connects to remote apcupsd. If network is down or apcupsd service does not respond, APCUPSd component does not initialize when HA is starting. After network recovery APCUPSd component does not reinitialize. Only HA restarting solves the problem.

Environment

Problem-relevant configuration.yaml

apcupsd:
  host: pve.lan
  port: 3551

Traceback/Error logs


Logger: homeassistant.components.apcupsd
Source: components/apcupsd/__init__.py:80
Integration: apcupsd (documentation, issues)
First occurred: 15:15:08 (1 occurrences)
Last logged: 15:15:08
Failure while testing APCUPSd status retrieval

Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/apcupsd/__init__.py", line 49, in setup
    apcups_data.update(no_throttle=True)
  File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/util/__init__.py", line 239, in wrapper
    result = method(*args, **kwargs)
  File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/apcupsd/__init__.py", line 85, in update
    self._status = self._get_status()
  File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/apcupsd/__init__.py", line 80, in _get_status
    return self._parse(self._get(host=self._host, port=self._port))
  File "/srv/homeassistant/lib/python3.8/site-packages/apcaccess/status.py", line 37, in get
    sock.connect((host, port))
socket.gaierror: [Errno -3] Temporary failure in name resolution

Additional information

frenck commented 4 years ago

I'm like really sure this is not a Home Assistant issue:

socket.gaierror: [Errno -3] Temporary failure in name resolution

The operating system still isn't capable of resolving DNS names, which means the network isn't fully up/restored yet.

epiniguin commented 4 years ago

After network recovery APCUPSd component does not reinitialize. Only HA restarting solves the problem.

github-actions[bot] commented 3 years ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.