core: SolarEdge local Exception importing

The problem

Cannot restart (or update anything) because the SolarEdge integrations has an Exception with importing.

What version of Home Assistant Core has the issue?

core-2023.4.5

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Container

Integration causing the issue

SolarEdge

Link to integration documentation on our website

https://www.home-assistant.io/integrations/solaredge/

Diagnostics information

home-assistant_solaredge_2023-04-21T13-51-27.158Z.log

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Logger: homeassistant.loader
Source: components/solaredge_local/sensor.py:12
First occurred: 18 april 2023 om 09:25:47 (13 occurrences)
Last logged: 14:53:29

Unexpected exception importing platform homeassistant.components.solaredge_local.sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/loader.py", line 779, in get_platform
    cache[full_name] = self._import_platform(platform_name)
  File "/usr/src/homeassistant/homeassistant/loader.py", line 796, in _import_platform
    return importlib.import_module(f"{self.pkg_path}.{platform_name}")
  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 "/usr/src/homeassistant/homeassistant/components/solaredge_local/sensor.py", line 12, in <module>
    from solaredge_local import SolarEdge
  File "/usr/local/lib/python3.10/site-packages/solaredge_local/__init__.py", line 1, in <module>
    from solaredge_local.solaredge import SolarEdge
  File "/usr/local/lib/python3.10/site-packages/solaredge_local/solaredge.py", line 2, in <module>
    from .maintenance_pb2 import Maintenance
  File "/usr/local/lib/python3.10/site-packages/solaredge_local/maintenance_pb2.py", line 35, in <module>
    _descriptor.FieldDescriptor(
  File "/usr/local/lib/python3.10/site-packages/google/protobuf/descriptor.py", line 561, 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

Additional information

No response

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 1
  • Comments: 24 (11 by maintainers)

Most upvoted comments

The root cause is the out of date _pb2.py files in the solaredge-local package.

See issue drobtravels/solaredge-local#30.

Unfortunately, the solaredge-local package does not appear to be actively maintained. There are several outstanding issues and PRs without response from the owner @drobtravels.

I’m happy to merge any PRs. The only ones I see are are dependency bot which have not been tested. This integration is not supported in the vast majority of cases, including mine, so I am not able to test.

I’m still getting the same error - or is this pending a HA update?

Update is pending, I see it’s merged now. Should make it to 2023.5 release.

Hey there @frenck, mind taking a look at this issue as it has been labeled with an integration (solaredge) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of solaredge can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign solaredge Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


solaredge documentation solaredge source (message by IssueLinks)