Pyatv: Error after ha start with version 4d871ff

Created on 28 Apr 2020  路  10Comments  路  Source: postlund/pyatv

Describe the bug
I got the following error after ha restart
To Reproduce

Expected behavior

System Setup (please complete the following information):

  • OS: Docker
  • Python: [e.g. 3.6.2]
  • pyatv: latest

    • Apple TV: Apple TV 4

Additional context

Logger: homeassistant.setup
Source: custom_components/apple_tv/__init__.py:8 
First occurred: 13:59:08 (1 occurrences) 
Last logged: 13:59:08

Setup failed for apple_tv: unknown error
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 137, in _async_setup_component
    component = integration.get_component()
  File "/usr/src/homeassistant/homeassistant/loader.py", line 270, in get_component
    cache[self.domain] = importlib.import_module(self.pkg_path)
  File "/usr/local/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/config/custom_components/apple_tv/__init__.py", line 8, in <module>
    from pyatv import connect, exceptions, scan
  File "/usr/local/lib/python3.7/site-packages/pyatv/__init__.py", line 20, in <module>
    from pyatv.mrp import MrpAppleTV
  File "/usr/local/lib/python3.7/site-packages/pyatv/mrp/__init__.py", line 25, in <module>
    from pyatv.mrp import messages, protobuf
  File "/usr/local/lib/python3.7/site-packages/pyatv/mrp/messages.py", line 140, in <module>
    identifier, send_error=protobuf.SendCommandResultMessage.SendError.NoError
AttributeError: 'EnumTypeWrapper' object has no attribute 'NoError'
bug

Most helpful comment

New update out now, please give it a spinn

All 10 comments

Exact same issue:

HA: 0.108.9 (docker)
AppleTV: Installed: 4d871ff

2020-04-28 14:10:39 ERROR (MainThread) [homeassistant.setup] Setup failed for apple_tv: unknown error
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/setup.py", line 137, in _async_setup_component
component = integration.get_component()
File "/usr/src/homeassistant/homeassistant/loader.py", line 268, in get_component
cache[self.domain] = importlib.import_module(self.pkg_path)
File "/usr/local/lib/python3.7/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1006, in _gcd_import
File "", line 983, in _find_and_load
File "", line 967, in _find_and_load_unlocked
File "", line 677, in _load_unlocked
File "", line 728, in exec_module
File "", line 219, in _call_with_frames_removed
File "/config/custom_components/apple_tv/__init__.py", line 8, in
from pyatv import connect, exceptions, scan
File "/usr/local/lib/python3.7/site-packages/pyatv/__init__.py", line 20, in
from pyatv.mrp import MrpAppleTV
File "/usr/local/lib/python3.7/site-packages/pyatv/mrp/__init__.py", line 25, in
from pyatv.mrp import messages, protobuf
File "/usr/local/lib/python3.7/site-packages/pyatv/mrp/messages.py", line 140, in
identifier, send_error=protobuf.SendCommandResultMessage.SendError.NoError
AttributeError: 'EnumTypeWrapper' object has no attribute 'NoError'

Ok, I believe this is because some integrations pull the version of protobuf used back to a very old version (tensorflow for instance), so that stuff I'm using here is probably not compatible. Will try to make a fix for it.

Fixing this in #624. Once merged I will make a new release of pyatv and bump it in the component.

Getting the same issue so cannot add the apple tv beta component to Home Assistant running on a Raspberry PI

`Logger: homeassistant.setup
Source: custom_components/apple_tv/__init__.py:8
First occurred: 5:24:43 PM (1 occurrences)
Last logged: 5:24:43 PM

Setup failed for apple_tv: unknown error
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/setup.py", line 137, in _async_setup_component
component = integration.get_component()
File "/usr/src/homeassistant/homeassistant/loader.py", line 268, in get_component
cache[self.domain] = importlib.import_module(self.pkg_path)
File "/usr/local/lib/python3.7/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1006, in _gcd_import
File "", line 983, in _find_and_load
File "", line 967, in _find_and_load_unlocked
File "", line 677, in _load_unlocked
File "", line 728, in exec_module
File "", line 219, in _call_with_frames_removed
File "/config/custom_components/apple_tv/__init__.py", line 8, in
from pyatv import connect, exceptions, scan
File "/usr/local/lib/python3.7/site-packages/pyatv/__init__.py", line 20, in
from pyatv.mrp import MrpAppleTV
File "/usr/local/lib/python3.7/site-packages/pyatv/mrp/__init__.py", line 25, in
from pyatv.mrp import messages, protobuf
File "/usr/local/lib/python3.7/site-packages/pyatv/mrp/messages.py", line 140, in
identifier, send_error=protobuf.SendCommandResultMessage.SendError.NoError
AttributeError: 'EnumTypeWrapper' object has no attribute 'NoError'
`

New update out now, please give it a spinn

Updates. Error is gone. Apple TV Entity is available again.

@postlund it will be update the HA integration as well?
Thanks

Mark

New update out now, please give it a spinn

Works!

@postlund it will be update the HA integration as well?

Thanks

Mark

Yep!

It is working again.

Was this page helpful?
0 / 5 - 0 ratings