fondberg / spotcast

Home assistant custom component to start Spotify playback on an idle chromecast device as well as control spotify connect devices
Apache License 2.0
676 stars 97 forks source link

Spotcast won't load after upgrade to 2022.4.6 #322

Open codypet opened 2 years ago

codypet commented 2 years ago

Bug Ticket

Describe the bug

The upgrade to 2022.4 caused a problem with both nest and Spotcast with Spotcast showing the error below. It was working prior to the upgrade

Environment

Configuration

spotcast:
  sp_dc:  ####
  sp_key: ####
  accounts:
    codypet: 
      sp_dc: ####
      sp_key: ####
    rory: 
      sp_dc: ####
      sp_key: ####

Service Call

If relevant, provide a yaml of the service call or explain the action taken to replicate the issue.

Additional context

Logger: homeassistant.loader Source: components/cast/init.py:7 First occurred: 11:15:29 AM (1 occurrences) Last logged: 11:15:29 AM

Unexpected exception importing component custom_components.spotcast
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/loader.py", line 584, in get_component
    cache[self.domain] = importlib.import_module(self.pkg_path)
  File "/usr/local/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/config/custom_components/spotcast/__init__.py", line 44, in <module>
    from .helpers import async_wrap, get_cast_devices, get_spotify_devices
  File "/config/custom_components/spotcast/helpers.py", line 11, in <module>
    from homeassistant.components.cast.media_player import CastDevice
  File "/usr/src/homeassistant/homeassistant/components/cast/__init__.py", line 7, in <module>
    from pychromecast import Chromecast
  File "/usr/local/lib/python3.9/site-packages/pychromecast/__init__.py", line 14, in <module>
    from . import socket_client
  File "/usr/local/lib/python3.9/site-packages/pychromecast/socket_client.py", line 23, in <module>
    from . import cast_channel_pb2
  File "/usr/local/lib/python3.9/site-packages/pychromecast/cast_channel_pb2.py", line 20, in <module>
    _SIGNATUREALGORITHM = DESCRIPTOR.enum_types_by_name['SignatureAlgorithm']
AttributeError: 'NoneType' object has no attribute 'enum_types_by_name'
fcusson commented 2 years ago

Hello @codypet,

Your problem is with a dependency, pychromecast. More specifically we were unable to import the dependency in the SpotCast code.

As you are running a supervised version of Home Assistant, you are responsible to maintain updated dependencies, home assistant will not update or block breaking updates. Could you verify what is your current version of pychromecast that you are currently running? It should be 0.7.6 to be on parity with what the docker uses for 2022.4.6.

fcusson commented 2 years ago

unable to replicate bug under development environnement

misha1183 commented 2 years ago

После обновления Home Assistant 2022.4.6 перестала работать интеграция Google Cast. (именно Spotcast, колонки Google home mini). Ранее работала нормально на протяжении практически года - все время использования Home Assistant.

fcusson commented 2 years ago

@misha1183, If you have additional information to help diagnose or resolve the issue, like error and debug logs or specific setup information, please provide.

Also, please provide information in English, this thread is supposed to provide diagnostics information for the community in a single place, having to go to google translate for some of the hinders that goal.

fcusson commented 2 years ago

После обновления Home Assistant 2022.4.6 перестала работать интеграция Google Cast. (именно Spotcast, колонки Google home mini). Ранее работала нормально на протяжении практически года - все время использования Home Assistant.

Translation:

Google Cast integration stopped working after Home Assistant 2022.4.6 update. (namely Spotcast, Google home mini speakers). Previously, it worked fine for almost a year - all the time using Home Assistant.

codypet commented 2 years ago

I guess technically now its just the Home Assistant Operating System (I've been confused on the naming since the renaming occurred) I'm running. So conceivably, this dependency will upgrade whenever the OS release comes out in a few weeks?

fcusson commented 2 years ago

hmm, that makes the behavior very strange since the docker is supposed to be a containerized version of HA-OS. Could you verify which version of pychromecast you have installed. If you have the terminal add-on install you simply have to type python in the terminal to launch the default python interpreter and then add the following lines (without the >>>):

>>> import pychromecast
>>> pychromecast.__version__
codypet commented 2 years ago

Yep I have that, however, I can't launch python. I get this error. zsh: command not found: python

fcusson commented 2 years ago

Yep I have that, however, I can't launch python. I get this error. zsh: command not found: python

Ok the difference between the docker and the hassio version seems to be quite different now. I'll set up a dummy raspberry pi install and try Spotcast on it.

codypet commented 2 years ago

Any new news on this. I tried instead of typing python, Python3 and got "No module named 'pychromecast' So I'm at a loss as to what's going on. Like I said, it was working for 2022.3.8.