Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in HA logs #2582

Open
sayam93 opened this issue Dec 6, 2024 · 1 comment
Open

Error in HA logs #2582

sayam93 opened this issue Dec 6, 2024 · 1 comment
Labels

Comments

@sayam93
Copy link

sayam93 commented Dec 6, 2024

Describe the bug

Saw the error in my HA logs.

On a separate note, volume control of Apple TV from HA doesn't work. It just shows the volume as 0. My Apple TV is connected to a bluetooth speaker.

Error log

Logger: pyatv.core.protocol
Source: /usr/local/lib/python3.13/site-packages/pyatv/core/protocol.py:110
First occurred: 3:32:21 PM (1 occurrences)
Last logged: 3:32:21 PM

error during dispatch
Traceback (most recent call last):
  File "/usr/local/lib/python3.13/asyncio/tasks.py", line 507, in wait_for
    return await fut
           ^^^^^^^^^
  File "/usr/local/lib/python3.13/asyncio/locks.py", line 213, in wait
    await fut
asyncio.exceptions.CancelledError

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

Traceback (most recent call last):
  File "/usr/local/lib/python3.13/site-packages/pyatv/protocols/companion/api.py", line 172, in _send_command
    resp = await self._protocol.exchange_opack(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<6 lines>...
    )
    ^
  File "/usr/local/lib/python3.13/site-packages/pyatv/protocols/companion/protocol.py", line 153, in exchange_opack
    return await self._exchange_generic_opack(frame_type, data, identifier, timeout)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/pyatv/protocols/companion/protocol.py", line 166, in _exchange_generic_opack
    unpacked_object = await self._queues[identifier].wait(timeout)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/pyatv/support/collections.py", line 161, in wait
    await asyncio.wait_for(self._event.wait(), timeout)
  File "/usr/local/lib/python3.13/asyncio/tasks.py", line 506, in wait_for
    async with timeouts.timeout(timeout):
               ~~~~~~~~~~~~~~~~^^^^^^^^^
  File "/usr/local/lib/python3.13/asyncio/timeouts.py", line 116, in __aexit__
    raise TimeoutError from exc_val
TimeoutError

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

Traceback (most recent call last):
  File "/usr/local/lib/python3.13/site-packages/pyatv/core/protocol.py", line 106, in _call_listener
    await func
  File "/usr/local/lib/python3.13/site-packages/pyatv/protocols/companion/__init__.py", line 421, in _handle_control_flag_update
    resp = await self.api.mediacontrol_command(MediaControlCommand.GetVolume)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/pyatv/protocols/companion/api.py", line 382, in mediacontrol_command
    return await self._send_command("_mcc", {"_mcc": command.value, **(args or {})})
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/pyatv/protocols/companion/api.py", line 183, in _send_command
    raise exceptions.ProtocolError(f"Command {identifier} failed") from ex
pyatv.exceptions.ProtocolError: Command _mcc failed

Log related to volume control:

Logger: homeassistant.components.websocket_api.http.connection
Source: components/websocket_api/commands.py:245
integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 3:40:28 PM (1 occurrences)
Last logged: 3:40:28 PM

[546617971696] Unexpected exception
Traceback (most recent call last):
  File "/usr/local/lib/python3.13/asyncio/tasks.py", line 507, in wait_for
    return await fut
           ^^^^^^^^^
  File "/usr/local/lib/python3.13/asyncio/locks.py", line 213, in wait
    await fut
asyncio.exceptions.CancelledError

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

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 245, in handle_call_service
    response = await hass.services.async_call(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<7 lines>...
    )
    ^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2802, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2845, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1007, in entity_service_call
    single_response = await _handle_entity_call(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
        hass, entity, func, data, call.context
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1079, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/apple_tv/media_player.py", line 552, in async_set_volume_level
    await self.atv.audio.set_volume(volume * 100.0)
  File "/usr/local/lib/python3.13/site-packages/pyatv/core/facade.py", line 479, in set_volume
    await self.relay("set_volume")(level)
  File "/usr/local/lib/python3.13/site-packages/pyatv/protocols/mrp/__init__.py", line 862, in set_volume
    await asyncio.wait_for(self._volume_event.wait(), timeout=5.0)
  File "/usr/local/lib/python3.13/asyncio/tasks.py", line 506, in wait_for
    async with timeouts.timeout(timeout):
               ~~~~~~~~~~~~~~~~^^^^^^^^^
  File "/usr/local/lib/python3.13/asyncio/timeouts.py", line 116, in __aexit__
    raise TimeoutError from exc_val
TimeoutError

How to reproduce the bug?

Error in HA Logs

What is expected behavior?

Error in HA Logs

Operating System

HAOS 14

Python

3.13

pyatv

0.16.0

Device

Apple TV 4K tvOS 18

Additional context

I got this error in my logs in HA Core 2024.12.0

@sayam93 sayam93 added the bug label Dec 6, 2024
@sayam93
Copy link
Author

sayam93 commented Dec 25, 2024

@postlund

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant