{"record":{"id":"8c0910816708c428","repo":"home-assistant/core","slug":"address-authentication-failed-try-reconfigurin","errorCode":null,"errorMessage":"{address}: Authentication failed, try reconfiguring device: {ex}","messagePattern":"(.+?): Authentication failed, try reconfiguring device: (.+?)","errorType":"exception","errorClass":"ConfigEntryAuthFailed","httpStatus":null,"severity":"error","filePath":"homeassistant/components/apple_tv/__init__.py","lineNumber":98,"sourceCode":"\n\nasync def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:\n    \"\"\"Set up the Apple TV component.\"\"\"\n    async_setup_services(hass)\n    return True\n\n\nasync def async_setup_entry(hass: HomeAssistant, entry: AppleTvConfigEntry) -> bool:\n    \"\"\"Set up a config entry for Apple TV.\"\"\"\n    manager = AppleTVManager(hass, entry)\n\n    if manager.is_on:\n        address = entry.data[CONF_ADDRESS]\n\n        try:\n            await manager.async_first_connect()\n        except AUTH_EXCEPTIONS as ex:\n            raise ConfigEntryAuthFailed(\n                f\"{address}: Authentication failed, try reconfiguring device: {ex}\"\n            ) from ex\n        except CONNECTION_TIMEOUT_EXCEPTIONS as ex:\n            raise ConfigEntryNotReady(f\"{address}: {ex}\") from ex\n        except DEVICE_EXCEPTIONS as ex:\n            _LOGGER.debug(\n                \"Error setting up apple_tv at %s: %s\", address, ex, exc_info=ex\n            )\n            raise ConfigEntryNotReady(f\"{address}: {ex}\") from ex\n\n    entry.runtime_data = manager\n\n    async def on_hass_stop(event: Event) -> None:\n        \"\"\"Stop push updates when hass stops.\"\"\"\n        await manager.disconnect()\n\n    entry.async_on_unload(\n        hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, on_hass_stop)","sourceCodeStart":80,"sourceCodeEnd":116,"githubUrl":"https://github.com/home-assistant/core/blob/58a3fdb3ea0538617f0a07efcfba6294de64fd59/homeassistant/components/apple_tv/__init__.py#L80-L116","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    await manager.async_first_connect()\nexcept AUTH_EXCEPTIONS as ex:\n    # surface re-auth to the user instead of retrying blindly","preventionTips":["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"],"tags":["home-assistant","apple-tv","authentication","pairing","pyatv"],"backgroundTag":null,"analyzedSha":"58a3fdb3ea0538617f0a07efcfba6294de64fd59","analyzedAt":"2026-08-14T20:54:38.818Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}