core icon indicating copy to clipboard operation
core copied to clipboard

Apple TV asking to reconfigure continiously

Open copetogo opened this issue 2 years ago • 1 comments

The problem

I have to reconfigure Apple tv repeatedly . attaching the log files for reference

What version of Home Assistant Core has the issue?

2023.4.6

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

apple TV

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Logger: homeassistant.components.apple_tv
Source: components/apple_tv/__init__.py:324
Integration: Apple TV (documentation, issues)
First occurred: April 22, 2023 at 6:26:15 PM (8985 occurrences)
Last logged: 6:57:15 PM

Authentication failed for dipta room, try reconfiguring device
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/pyatv/protocols/companion/protocol.py", line 121, in _setup_encryption
    await pair_verifier.verify_credentials()
  File "/usr/local/lib/python3.10/site-packages/pyatv/protocols/companion/auth.py", line 161, in verify_credentials
    encrypted_data = self.srp.verify1(self.credentials, server_pub_key, encrypted)
  File "/usr/local/lib/python3.10/site-packages/pyatv/auth/hap_srp.py", line 101, in verify1
    raise exceptions.AuthenticationError("incorrect device response")
pyatv.exceptions.AuthenticationError: incorrect device response

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/apple_tv/__init__.py", line 222, in connect_once
    await self._connect(conf, raise_missing_credentials)
  File "/usr/src/homeassistant/homeassistant/components/apple_tv/__init__.py", line 324, in _connect
    self.atv = await connect(conf, self.hass.loop, session=session)
  File "/usr/local/lib/python3.10/site-packages/pyatv/__init__.py", line 135, in connect
    await atv.connect()
  File "/usr/local/lib/python3.10/site-packages/pyatv/core/facade.py", line 575, in connect
    if await setup_data.connect():
  File "/usr/local/lib/python3.10/site-packages/pyatv/protocols/companion/__init__.py", line 411, in _connect
    await api.connect()
  File "/usr/local/lib/python3.10/site-packages/pyatv/protocols/companion/api.py", line 121, in connect
    await self._protocol.start()
  File "/usr/local/lib/python3.10/site-packages/pyatv/protocols/companion/protocol.py", line 108, in start
    await self._setup_encryption()
  File "/usr/local/lib/python3.10/site-packages/pyatv/protocols/companion/protocol.py", line 127, in _setup_encryption
    raise exceptions.AuthenticationError(str(ex)) from ex
pyatv.exceptions.AuthenticationError: incorrect device response

Additional information

No response

copetogo avatar May 01 '23 13:05 copetogo

Hey there @postlund, mind taking a look at this issue as it has been labeled with an integration (apple_tv) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of apple_tv can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign apple_tv Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


apple_tv documentation apple_tv source (message by IssueLinks)

home-assistant[bot] avatar May 01 '23 17:05 home-assistant[bot]

Same issue - I will receive a notification to reconfigure at least once a day. Since the new core update, I am now also getting a notification that Apple TV is misconfigured in my config however I don’t have an entry for the integration in there.

kid-pro-kuo avatar May 04 '23 17:05 kid-pro-kuo

This is from home-assistant.log but not 100% if this relates to this issue or not.

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 845, in async_init
    flow, result = await task
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 863, in _async_init
    flow = await self.async_create_flow(handler, context=context, data=data)
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 962, in async_create_flow
    await _load_integration(self.hass, handler_key, self._hass_config)
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 2026, in _load_integration
    await async_process_deps_reqs(hass, hass_config, integration)
  File "/usr/src/homeassistant/homeassistant/setup.py", line 389, in async_process_deps_reqs
    await requirements.async_get_integration_with_requirements(
  File "/usr/src/homeassistant/homeassistant/requirements.py", line 52, in async_get_integration_with_requirements
    return await manager.async_get_integration_with_requirements(domain)
  File "/usr/src/homeassistant/homeassistant/requirements.py", line 171, in async_get_integration_with_requirements
    await self._async_process_integration(integration, done)
  File "/usr/src/homeassistant/homeassistant/requirements.py", line 186, in _async_process_integration
    await self.async_process_requirements(
  File "/usr/src/homeassistant/homeassistant/requirements.py", line 246, in async_process_requirements
    self._raise_for_failed_requirements(name, missing)
  File "/usr/src/homeassistant/homeassistant/requirements.py", line 275, in _raise_for_failed_requirements
    raise RequirementsNotFound(integration, [req])
homeassistant.requirements.RequirementsNotFound: Requirements for apple_tv not found: ['pyatv==0.10.0'].```

baylanger avatar May 04 '23 19:05 baylanger

Remove the apple tv beta custom component, delete the integration, restart, and re-add the integration.

bdraco avatar May 04 '23 19:05 bdraco

@bdraco thanx for your reply. I had tried that already and not helping. After de-installing via hacs the integration, restarting HA and re-installing, restarting HA I still see:

2023-05-04 15:36:54.660 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 845, in async_init
    flow, result = await task
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 863, in _async_init
    flow = await self.async_create_flow(handler, context=context, data=data)
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 962, in async_create_flow
    await _load_integration(self.hass, handler_key, self._hass_config)
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 2026, in _load_integration
    await async_process_deps_reqs(hass, hass_config, integration)
  File "/usr/src/homeassistant/homeassistant/setup.py", line 389, in async_process_deps_reqs
    await requirements.async_get_integration_with_requirements(
  File "/usr/src/homeassistant/homeassistant/requirements.py", line 52, in async_get_integration_with_requirements
    return await manager.async_get_integration_with_requirements(domain)
  File "/usr/src/homeassistant/homeassistant/requirements.py", line 163, in async_get_integration_with_requirements
    raise IntegrationNotFound(domain)
homeassistant.loader.IntegrationNotFound: Integration 'apple_tv' not found.

And when trying to add the integration, I get the following pop-up.

Config flow could not be loaded: 500 Internal Server Error Server got itself in trouble

Also findind this in the logs

2023-05-04 15:36:35.350 ERROR (SyncWorker_2) [homeassistant.util.package] Unable to install package pyatv==0.10.0: ERROR: Cannot install pyatv==0.10.0 because these package versions have conflicting dependencies.```

baylanger avatar May 04 '23 19:05 baylanger

Rebuild the core container after removing the custom component

bdraco avatar May 04 '23 20:05 bdraco

I removed the integration using the hacs UI, restarted HA. Waited then ran "core rebuild". Waited then re-installed the integration, then did a HA restart.

Still seeing this

2023-05-04 19:14:16.823 ERROR (SyncWorker_10) [homeassistant.util.package] Unable to install package pyatv==0.10.0: ERROR: Cannot install pyatv==0.10.0 because these package versions have conflicting dependencies.```

baylanger avatar May 04 '23 23:05 baylanger

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.

I am also having this issue and I also previously had the HACS component installed.

Rebuild the core container after removing the custom component

@bdraco How do I rebuild the core? Is it this service: homeassistant.reload_core_config?

marleyjaffe avatar Aug 20 '23 16:08 marleyjaffe