djtimca / hagooglewifi

Home Assistant integration for Google Wifi systems.
Apache License 2.0
79 stars 26 forks source link

Unexpected exception importing component custom_components.googlewifi #82

Closed droopanu closed 1 year ago

droopanu commented 1 year ago

After upgrading python to 3.10, I get the following error: Home Assistant Core 2023.1.4 installed in venv

`2023-01-16 11:00:23.244 ERROR (MainThread) [homeassistant.loader] Unexpected exception importing component custom_components.googlewifi Traceback (most recent call last): File "/srv/homeassistant/lib/python3.10/site-packages/homeassistant/loader.py", line 725, in get_component cache[self.domain] = importlib.import_module(self.pkg_path) File "/usr/lib/python3.10/importlib/init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1050, in _gcd_import File "", line 1027, in _find_and_load File "", line 1006, in _find_and_load_unlocked File "", line 688, in _load_unlocked File "", line 883, in exec_module File "", line 241, in _call_with_frames_removed File "/home/homeassistant/.homeassistant/custom_components/googlewifi/init.py", line 8, in from googlewifi import GoogleHomeIgnoreDevice, GoogleWifi, GoogleWifiException File "/srv/homeassistant/lib/python3.10/site-packages/googlewifi/init.py", line 8, in from .v1_pb2 import GetHomeGraphRequest File "/srv/homeassistant/lib/python3.10/site-packages/googlewifi/v1_pb2.py", line 29, in _NONE = _descriptor.Descriptor( File "/srv/homeassistant/lib/python3.10/site-packages/google/protobuf/descriptor.py", line 313, in new _message.Message._CheckCalledFromGeneratedFile() TypeError: Descriptors cannot not be created directly. If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0. If you cannot immediately regenerate your protos, some other possible workarounds are:

  1. Downgrade the protobuf package to 3.20.x or lower.
  2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).

More information: https://developers.google.com/protocol-buffers/docs/news/2022-05-06#python-updates 2023-01-16 11:00:23.247 ERROR (MainThread) [homeassistant.setup] Setup failed for custom integration googlewifi: Unable to import component: Exception importing custom_components.googlewifi `

DerekF35 commented 1 year ago

After updating to x.34 and x.35 I'm receiving the following errors now. I do not receive it when running x.33. I should note that I also have Google Home installed as well.

This error originated from a custom integration.

Logger: homeassistant.loader
Source: custom_components/googlewifi/__init__.py:8
Integration: googlewifi (documentation, issues)
First occurred: 6:46:04 PM (1 occurrences)
Last logged: 6:46:04 PM

Unexpected exception importing component custom_components.googlewifi
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/loader.py", line 730, in get_component
    cache[self.domain] = importlib.import_module(self.pkg_path)
  File "/usr/local/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/config/custom_components/googlewifi/__init__.py", line 8, in <module>
    from googlewifi import GoogleHomeIgnoreDevice, GoogleWifi, GoogleWifiException
  File "/usr/local/lib/python3.10/site-packages/googlewifi/__init__.py", line 8, in <module>
    from ghome_foyer_api.api_pb2 import GetHomeGraphRequest
  File "/usr/local/lib/python3.10/site-packages/ghome_foyer_api/api_pb2.py", line 18, in <module>
    DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(
  File "/usr/local/lib/python3.10/site-packages/google/protobuf/descriptor_pool.py", line 220, in AddSerializedFile
    file_desc = self._ConvertFileProtoToFileDescriptor(file_desc_proto)
  File "/usr/local/lib/python3.10/site-packages/google/protobuf/descriptor_pool.py", line 771, in _ConvertFileProtoToFileDescriptor
    message_desc = self._ConvertMessageDescriptor(
  File "/usr/local/lib/python3.10/site-packages/google/protobuf/descriptor_pool.py", line 913, in _ConvertMessageDescriptor
    self._CheckConflictRegister(desc, desc.full_name, desc.file.name)
  File "/usr/local/lib/python3.10/site-packages/google/protobuf/descriptor_pool.py", line 192, in _CheckConflictRegister
    raise TypeError(error_msg)
TypeError: Conflict register for file "ghome_foyer_api/api.proto": google.internal.home.foyer.v1.GetAssistantRoutinesRequest is already defined in file "google/internal/home/foyer/v1.proto". Please fix the conflict by adding package name on the proto file, or use different name for the duplication.