home-assistant/core · error · UpdateFailed

Error communicating with API: {err}

Error message

Error communicating with API: {err}

What it means

UpdateFailed with message 'Error communicating with API: {err}' raised in _async_update_data when bapi.async_get_things(force=True) fails with ServerDisconnectedError. Related paths: 403 raises ConfigEntryAuthFailed and 401 triggers a warning plus entry reload; other ClientResponseError cases raise bare UpdateFailed. The coordinator will retry on its interval.

Source

Thrown at homeassistant/components/brunt/coordinator.py:78

                f" {self.config_entry.data[CONF_USERNAME]}."
            ) from exc

    @override
    async def _async_update_data(self) -> dict[str | None, Thing]:
        """Fetch data from the Brunt endpoint for all Things.

        Error 403 is the API response for any kind of
        authentication error (failed password or email)
        Error 401 is the API response for things that are not
        part of the account, could happen when a device is
        deleted from the account.
        """
        try:
            async with timeout(10):
                things = await self.bapi.async_get_things(force=True)
                return {thing.serial: thing for thing in things}
        except ServerDisconnectedError as err:
            raise UpdateFailed(f"Error communicating with API: {err}") from err
        except ClientResponseError as err:
            if err.status == 403:
                raise ConfigEntryAuthFailed from err
            if err.status == 401:
                _LOGGER.warning("Device not found, will reload Brunt integration")
                await self.hass.config_entries.async_reload(self.config_entry.entry_id)
            raise UpdateFailed from err

View on GitHub (pinned to 58a3fdb3ea)

Solutions

  1. Wait for the next coordinator poll — ServerDisconnectedError is usually transient
  2. Confirm Brunt cloud availability via the mobile app
  3. If paired with 403s, reauthenticate (credentials issue, not connectivity)
  4. If paired with 401s, a device was deleted from the account — the integration reloads itself; remove stale devices
Defensive patterns

Strategy: retry

Try / catch

try:
    data = await coordinator.async_refresh()
except UpdateFailed:
    # Brunt API dropped the connection; coordinator retries on its interval
    pass

Prevention

When it happens

Trigger: Brunt cloud server dropping the connection during a periodic things poll; transient network interruption; server-side restarts during polling windows.

Common situations: Recurring coordinator failures during Brunt outages; entities flapping unavailable; long-running setups hitting nightly API maintenance.

Related errors


AI-assisted analysis of home-assistant/core@58a3fdb3ea (2026-08-14). Data as JSON: /api/errors/57770def674718d4. Report an issue: GitHub.