home-assistant/core · error · ConfigEntryAuthFailed
{address}: Authentication failed, try reconfiguring device:
Error message
{address}: Authentication failed, try reconfiguring device: {ex} What it means
ConfigEntryAuthFailed raised during apple_tv setup when the first connection to the device fails with an authentication error (AUTH_EXCEPTIONS from pyatv, e.g. NoCredentialsError, AuthenticationError). This moves the config entry into a 'reauthenticate' state so the user is prompted to redo pairing instead of HA endlessly retrying a connection that can never succeed.
Source
Thrown at homeassistant/components/apple_tv/__init__.py:98
async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
"""Set up the Apple TV component."""
async_setup_services(hass)
return True
async def async_setup_entry(hass: HomeAssistant, entry: AppleTvConfigEntry) -> bool:
"""Set up a config entry for Apple TV."""
manager = AppleTVManager(hass, entry)
if manager.is_on:
address = entry.data[CONF_ADDRESS]
try:
await manager.async_first_connect()
except AUTH_EXCEPTIONS as ex:
raise ConfigEntryAuthFailed(
f"{address}: Authentication failed, try reconfiguring device: {ex}"
) from ex
except CONNECTION_TIMEOUT_EXCEPTIONS as ex:
raise ConfigEntryNotReady(f"{address}: {ex}") from ex
except DEVICE_EXCEPTIONS as ex:
_LOGGER.debug(
"Error setting up apple_tv at %s: %s", address, ex, exc_info=ex
)
raise ConfigEntryNotReady(f"{address}: {ex}") from ex
entry.runtime_data = manager
async def on_hass_stop(event: Event) -> None:
"""Stop push updates when hass stops."""
await manager.disconnect()
entry.async_on_unload(
hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, on_hass_stop)View on GitHub (pinned to 58a3fdb3ea)
Solutions
- Open the entry in HA settings and follow the reconfigure/reauthenticate flow to re-pair
- Verify you can pair with 'atvremote ... pair' from the pyatv CLI to isolate HA from device issues
- If the device was factory reset, remove the integration entry and set it up again from scratch
Defensive patterns
Strategy: fallback
Try / catch
try:
await manager.async_first_connect()
except AUTH_EXCEPTIONS as ex:
# surface re-auth to the user instead of retrying blindly Prevention
- Re-pair promptly after factory resets or OS reinstalls
- Keep one pairing per device; avoid pairing the same Apple TV to multiple systems with exclusive credentials
- Watch for the reauthenticate badge on the config entry after tvOS updates
When it happens
Trigger: manager.async_first_connect() raises a pyatv authentication exception: device was factory reset (old credentials invalid), credentials were deleted on the Apple TV, the device was re-paired with another system invalidating this one, or pairing never completed for a required protocol.
Common situations: Apple TV updated/reset and dropped paired keys; user re-paired the device with another Home Assistant instance or with pyatv CLI; credentials in the config entry are stale after a hardware swap of the same IP.
Understand the failure class
- Authentication and authorization failures — expired tokens, bad credentials, and missing scopes.
Related errors
- streaming_not_supported
- stream_failed
- Command not found. Exiting sequence
- keyboard_not_available
- keyboard_error
AI-assisted analysis of home-assistant/core@58a3fdb3ea (2026-08-14).
Data as JSON: /api/errors/8c0910816708c428.
Report an issue: GitHub.