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

incompatible with protobuf 5.26.1 #2394

Open
gtalusan opened this issue Apr 22, 2024 · 0 comments
Open

incompatible with protobuf 5.26.1 #2394

gtalusan opened this issue Apr 22, 2024 · 0 comments
Labels

Comments

@gtalusan
Copy link

Describe the bug

I attempted to install pyatv. pip3 installed it with protobuf 5.26.1. A stack trace is produced when running atvremote.

Error log

Install pyatv and note that protobuf 5.26.1 is installed.

limbo:/usr/src/node-red# pip3 install --upgrade pyatv
...
Collecting protobuf>=4.23.4 (from pyatv)
  Downloading protobuf-5.26.1-py3-none-any.whl (161 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 161.2/161.2 kB 10.0 MB/s eta 0:00:00

I tried running atvremote but it errored out with this stack:

limbo:/usr/src/node-red# atvremote
Traceback (most recent call last):
  File "/usr/bin/atvremote", line 5, in <module>
    from pyatv.scripts.atvremote import main
  File "/usr/lib/python3.11/site-packages/pyatv/__init__.py", line 26, in <module>
    from pyatv.protocols import PROTOCOLS
  File "/usr/lib/python3.11/site-packages/pyatv/protocols/__init__.py", line 10, in <module>
    from pyatv.protocols import airplay as airplay_proto
  File "/usr/lib/python3.11/site-packages/pyatv/protocols/airplay/__init__.py", line 28, in <module>
    from pyatv.protocols import mrp
  File "/usr/lib/python3.11/site-packages/pyatv/protocols/mrp/__init__.py", line 60, in <module>
    from pyatv.protocols.mrp import messages, protobuf
  File "/usr/lib/python3.11/site-packages/pyatv/protocols/mrp/messages.py", line 9, in <module>
    from pyatv.protocols.mrp import protobuf
  File "/usr/lib/python3.11/site-packages/pyatv/protocols/mrp/protobuf/__init__.py", line 9, in <module>
    from . import AudioFadeMessage_pb2
  File "/usr/lib/python3.11/site-packages/pyatv/protocols/mrp/protobuf/AudioFadeMessage_pb2.py", line 15, in <module>
    from pyatv.protocols.mrp.protobuf import PlayerPath_pb2 as pyatv_dot_protocols_dot_mrp_dot_protobuf_dot_PlayerPath__pb2
  File "/usr/lib/python3.11/site-packages/pyatv/protocols/mrp/protobuf/PlayerPath_pb2.py", line 14, in <module>
    from pyatv.protocols.mrp.protobuf import Origin_pb2 as pyatv_dot_protocols_dot_mrp_dot_protobuf_dot_Origin__pb2
  File "/usr/lib/python3.11/site-packages/pyatv/protocols/mrp/protobuf/Origin_pb2.py", line 14, in <module>
    from pyatv.protocols.mrp.protobuf import DeviceInfoMessage_pb2 as pyatv_dot_protocols_dot_mrp_dot_protobuf_dot_DeviceInfoMessage__pb2
  File "/usr/lib/python3.11/site-packages/pyatv/protocols/mrp/protobuf/DeviceInfoMessage_pb2.py", line 24, in <module>
    pyatv_dot_protocols_dot_mrp_dot_protobuf_dot_ProtocolMessage__pb2.ProtocolMessage.RegisterExtension(deviceInfoMessage)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: type object 'ProtocolMessage' has no attribute 'RegisterExtension'

I then downgraded protobuf to the previous 4.25.x release:

limbo:/usr/src/node-red# pip3 install protobuf==4.25.3
Collecting protobuf==4.25.3
  Downloading protobuf-4.25.3-py3-none-any.whl (156 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 156.5/156.5 kB 3.0 MB/s eta 0:00:00
Installing collected packages: protobuf
  Attempting uninstall: protobuf
    Found existing installation: protobuf 5.26.1
    Uninstalling protobuf-5.26.1:
      Successfully uninstalled protobuf-5.26.1
Successfully installed protobuf-4.25.3

... and atvremote started working:

limbo:/usr/src/node-red# atvremote
usage: atvremote [-h] [--storage {file,none}] [--storage-filename STORAGE_FILENAME] [-i ID] [-n NAME] [--address ADDRESS] [--protocol PROTOCOL] [--port PORT] [-t TIMEOUT] [-s SCAN_HOSTS] [--scan-protocols SCAN_PROTOCOLS] [--version] [--remote-name REMOTE_NAME] [-p PIN]
                 [--pairing-guid PAIRING_GUID] [-m] [--service-properties SERVICE_PROPERTIES] [--dmap-credentials DMAP_CREDENTIALS] [--mrp-credentials MRP_CREDENTIALS] [--airplay-credentials AIRPLAY_CREDENTIALS] [--companion-credentials COMPANION_CREDENTIALS]
                 [--raop-credentials RAOP_CREDENTIALS] [--airplay-password AIRPLAY_PASSWORD] [--raop-password RAOP_PASSWORD] [-v] [--debug] [--mdns-debug]
                 command [command ...]
atvremote: error: the following arguments are required: command

How to reproduce the bug?

Install pyatv with protobuf 5.26.1

What is expected behavior?

A working atvremote!

Operating System

Linux

Python

Other

pyatv

0.14.5

Device

Apple TV 4K

Additional context

N/A

@gtalusan gtalusan added the bug label Apr 22, 2024
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