Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

two (custom) integrations can't load anymore #96521

Closed
ChristophCaina opened this issue Jul 14, 2023 · 10 comments
Closed

two (custom) integrations can't load anymore #96521

ChristophCaina opened this issue Jul 14, 2023 · 10 comments

Comments

@ChristophCaina
Copy link
Contributor

ChristophCaina commented Jul 14, 2023

The problem

Since yesterday evening, I am getting the following config-errors for my HomeAssistant Installation and two custom integrations can't load anymore:

Logger: homeassistant.setup
Source: custom_components/zha_toolkit/utils.py:16
Integration: 🧰 ZHA Toolkit (documentation, issues)
First occurred: 06:58:27 (1 occurrences)
Last logged: 06:58:27

Setup failed for custom integration zha_toolkit: Unable to import component: cannot import name '__version__' from 'zigpy' (/usr/local/lib/python3.11/site-packages/zigpy/__init__.py)
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 215, in _async_setup_component
    component = integration.get_component()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 813, in get_component
    ComponentProtocol, importlib.import_module(self.pkg_path)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/config/custom_components/zha_toolkit/__init__.py", line 11, in <module>
    from . import utils as u
  File "/config/custom_components/zha_toolkit/utils.py", line 16, in <module>
    from zigpy import __version__ as zigpy_version
ImportError: cannot import name '__version__' from 'zigpy' (/usr/local/lib/python3.11/site-packages/zigpy/__init__.py)
Logger: homeassistant.components.hassio
Source: components/hassio/__init__.py:568
Integration: Home Assistant Supervisor (documentation, issues)
First occurred: 07:01:47 (1 occurrences)
Last logged: 07:01:47

The system cannot restart because the configuration is not valid: Component error: zha_toolkit - cannot import name '__version__' from 'zigpy' (/usr/local/lib/python3.11/site-packages/zigpy/__init__.py)
Logger: homeassistant.components.websocket_api.http.connection
Source: components/hassio/__init__.py:579
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 07:01:47 (1 occurrences)
Last logged: 07:01:47

[139735400947408] The system cannot restart because the configuration is not valid: Component error: zha_toolkit - cannot import name '__version__' from 'zigpy' (/usr/local/lib/python3.11/site-packages/zigpy/__init__.py)
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 205, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1965, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2005, in _execute_service
    return await cast(
           ^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/hassio/__init__.py", line 579, in async_handle_core_service
    raise HomeAssistantError(
homeassistant.exceptions.HomeAssistantError: The system cannot restart because the configuration is not valid: Component error: zha_toolkit - cannot import name '__version__' from 'zigpy' (/usr/local/lib/python3.11/site-packages/zigpy/__init__.py)
Logger: homeassistant.setup
Source: custom_components/solaredge_modbus/__init__.py:12
Integration: SolarEdge Modbus (documentation)
First occurred: 06:58:27 (1 occurrences)
Last logged: 06:58:27

Setup failed for custom integration solaredge_modbus: Unable to import component: cannot import name 'make_byte_string' from 'pymodbus.utilities' (/usr/local/lib/python3.11/site-packages/pymodbus/utilities.py)
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 215, in _async_setup_component
    component = integration.get_component()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 813, in get_component
    ComponentProtocol, importlib.import_module(self.pkg_path)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/config/custom_components/solaredge_modbus/__init__.py", line 12, in <module>
    from pymodbus.payload import BinaryPayloadDecoder
  File "/usr/local/lib/python3.11/site-packages/pymodbus/payload.py", line 13, in <module>
    from pymodbus.utilities import (
ImportError: cannot import name 'make_byte_string' from 'pymodbus.utilities' (/usr/local/lib/python3.11/site-packages/pymodbus/utilities.py)

Affected integrations are ZHA Toolkit and SolarEdge Modbus.
Both are reporting issues with a "frozen importlib._bootstrap"

Since the issue seems to be the same for both integrations, I am unsure if the issue itself comes from the custom integration or from the core / supervisor itself.

What version of Home Assistant Core has the issue?

2023.7.2

What was the last working version of Home Assistant Core?

2023.7

What type of installation are you running?

Home Assistant OS

Integration causing the issue

No response

Link to integration documentation on our website

No response

Diagnostics information

I am pretty sure that the integrations did work even after installing 2023.7.1
After a restart yesterday evening due to updates on other integrations through HACS, the following error has been reported and the integrations do not start anymore.

I've applied the 2023.7.2 update, but the integrations did not came back again.
I can't even restart HA, because it is showing an invalid config due to these errors...

image

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Logger: homeassistant.setup
Source: custom_components/zha_toolkit/utils.py:16
Integration: 🧰 ZHA Toolkit (documentation, issues)
First occurred: 06:58:27 (1 occurrences)
Last logged: 06:58:27

Setup failed for custom integration zha_toolkit: Unable to import component: cannot import name '__version__' from 'zigpy' (/usr/local/lib/python3.11/site-packages/zigpy/__init__.py)
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 215, in _async_setup_component
    component = integration.get_component()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 813, in get_component
    ComponentProtocol, importlib.import_module(self.pkg_path)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/config/custom_components/zha_toolkit/__init__.py", line 11, in <module>
    from . import utils as u
  File "/config/custom_components/zha_toolkit/utils.py", line 16, in <module>
    from zigpy import __version__ as zigpy_version
ImportError: cannot import name '__version__' from 'zigpy' (/usr/local/lib/python3.11/site-packages/zigpy/__init__.py)
Logger: homeassistant.components.hassio
Source: components/hassio/__init__.py:568
Integration: Home Assistant Supervisor (documentation, issues)
First occurred: 07:01:47 (1 occurrences)
Last logged: 07:01:47

The system cannot restart because the configuration is not valid: Component error: zha_toolkit - cannot import name '__version__' from 'zigpy' (/usr/local/lib/python3.11/site-packages/zigpy/__init__.py)
Logger: homeassistant.components.websocket_api.http.connection
Source: components/hassio/__init__.py:579
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 07:01:47 (1 occurrences)
Last logged: 07:01:47

[139735400947408] The system cannot restart because the configuration is not valid: Component error: zha_toolkit - cannot import name '__version__' from 'zigpy' (/usr/local/lib/python3.11/site-packages/zigpy/__init__.py)
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 205, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1965, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2005, in _execute_service
    return await cast(
           ^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/hassio/__init__.py", line 579, in async_handle_core_service
    raise HomeAssistantError(
homeassistant.exceptions.HomeAssistantError: The system cannot restart because the configuration is not valid: Component error: zha_toolkit - cannot import name '__version__' from 'zigpy' (/usr/local/lib/python3.11/site-packages/zigpy/__init__.py)
Logger: homeassistant.setup
Source: custom_components/solaredge_modbus/__init__.py:12
Integration: SolarEdge Modbus (documentation)
First occurred: 06:58:27 (1 occurrences)
Last logged: 06:58:27

Setup failed for custom integration solaredge_modbus: Unable to import component: cannot import name 'make_byte_string' from 'pymodbus.utilities' (/usr/local/lib/python3.11/site-packages/pymodbus/utilities.py)
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 215, in _async_setup_component
    component = integration.get_component()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 813, in get_component
    ComponentProtocol, importlib.import_module(self.pkg_path)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/config/custom_components/solaredge_modbus/__init__.py", line 12, in <module>
    from pymodbus.payload import BinaryPayloadDecoder
  File "/usr/local/lib/python3.11/site-packages/pymodbus/payload.py", line 13, in <module>
    from pymodbus.utilities import (
ImportError: cannot import name 'make_byte_string' from 'pymodbus.utilities' (/usr/local/lib/python3.11/site-packages/pymodbus/utilities.py)

Additional information

No response

@klaus1956
Copy link

Same issue here

@benoitc
Copy link

benoitc commented Jul 14, 2023

reproduced here as well with latest versions installed

@MikeDeltaHH
Copy link

MikeDeltaHH commented Jul 14, 2023

Same here after update to 2023.7.2! Revert back to 2023.7.1 solved the issue!

@atmezferix
Copy link

Same issue for me with ZHA toolkit, just rolling back to 2023.7.1

@egelinotte
Copy link

I have the same problem with zha toolkit. Restored to 2023.7.1 too.

@ChristophCaina
Copy link
Contributor Author

I have the same problem with zha toolkit. Restored to 2023.7.1 too.

a fix for ZHA Toolkit should be available, soon...
mdeweerd/zha-toolkit#177

@egelinotte
Copy link

Will this fix work for both ? (7.1 and 7.2)

@sonnstein
Copy link

same here!

@ChristophCaina
Copy link
Contributor Author

Will this fix work for both ? (7.1 and 7.2)

should. But it hasn't been yet released officially.
I think, they are still running some tests with updating to 7.2

@cgarwood
Copy link
Member

Closing, as this is an issue with a custom integration. Please report it to the developer of the zha_toolkit integration.

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

No branches or pull requests

9 participants