Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Invalid config after latest update to v24.12.08_10 #309

Open
MichaelSmet182 opened this issue Dec 9, 2024 · 16 comments
Open

Invalid config after latest update to v24.12.08_10 #309

MichaelSmet182 opened this issue Dec 9, 2024 · 16 comments
Labels
bug Something isn't working

Comments

@MichaelSmet182
Copy link

Description

After the latest update has been installed config has become invalid

Reproduction Steps

Invalid config
The following integrations and platforms could not be set up:

solarman (Show logs)
Please check your config and logs.

Log

HA SOLARMAN log.docx

Version

24.12.08

Home Assistant Version

2024.12.1

@MichaelSmet182 MichaelSmet182 added the bug Something isn't working label Dec 9, 2024
@davidrapan
Copy link
Owner

Hi @MichaelSmet182, please provide log w/ .log ext.

@afkdk
Copy link

afkdk commented Dec 9, 2024

Logger: homeassistant.setup
Source: setup.py:334
First occurred: 21:45:51 (1 occurrences)
Last logged: 21:45:51

Setup failed for custom integration 'solarman': Unable to import component: No module named 'pysolarmanv5'
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/setup.py", line 334, in _async_setup_component
component = await integration.async_get_component()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/loader.py", line 1034, in async_get_component
self._component_future.result()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/usr/src/homeassistant/homeassistant/loader.py", line 1014, in async_get_component
comp = await self.hass.async_add_import_executor_job(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
self._get_component, True
^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/usr/local/lib/python3.13/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/homeassistant/homeassistant/loader.py", line 1074, in _get_component
ComponentProtocol, importlib.import_module(self.pkg_path)
~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/util/loop.py", line 200, in protected_loop_func
return func(*args, **kwargs)
File "/usr/local/lib/python3.13/importlib/init.py", line 88, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 1387, in _gcd_import
File "", line 1360, in _find_and_load
File "", line 1331, in _find_and_load_unlocked
File "", line 935, in _load_unlocked
File "", line 1022, in exec_module
File "", line 488, in _call_with_frames_removed
File "/config/custom_components/solarman/init.py", line 16, in
from .coordinator import Inverter, InverterCoordinator
File "/config/custom_components/solarman/coordinator.py", line 11, in
from .api import Inverter
File "/config/custom_components/solarman/api.py", line 16, in
from .include.pysolarmanv5 import PySolarmanV5Async, V5FrameError
File "/config/custom_components/solarman/include/pysolarmanv5/init.py", line 4, in
from pysolarmanv5.pysolarmanv5 import PySolarmanV5
ModuleNotFoundError: No module named 'pysolarmanv5'

@davidrapan
Copy link
Owner

I's not issue w/ this integration but, either:

  • Upgrade HA Core
  • Downgrade and then upgrade HA Core
  • Update integration to the latest version where is not pysolarmanv5 used as module

@afkdk
Copy link

afkdk commented Dec 10, 2024

Ack'ed - please disregard my aim to help woth the log...

The error message and symptoms are identical!
I have just installed the new core 12.2 release to ser if that Jeps - same error/bug with missing sutoload...

Then it is likely the custom integration that neefs dine update?

@davidrapan
Copy link
Owner

davidrapan commented Dec 11, 2024

Then it is likely the custom integration that needs done update?

It certainly does not, this is issue w/ HA but if you install latest version issue will be gone because there isn't dependency on pysolarmav5 anymore.

You can read more 'bout this in #299

@znack14
Copy link

znack14 commented Dec 11, 2024

After updating to 12.2, I have the same error.

@Adminius
Copy link

Adminius commented Dec 11, 2024

same here:
Core 12.2, Plugin 24.12.08_9
image
No logs, can't even start debug. All devices are "not loaded"

EDIT: updated to 24.12.10_2: setup errors
image

Log:

Logger: homeassistant.config_entries
Quelle: config_entries.py:640
Erstmals aufgetreten: 13:24:24 (3 Vorkommnisse)
Zuletzt protokolliert: 13:24:43

Error setting up entry MIFO for solarman
Error setting up entry MICW for solarman
Error setting up entry MIFM for solarman
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 640, in __async_setup_with_context
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/solarman/__init__.py", line 59, in async_setup_entry
    await async_migrate_entries(hass, config_entry.entry_id, partial(migrate_unique_ids, config.name, config.serial))
  File "/usr/src/homeassistant/homeassistant/helpers/entity_registry.py", line 1636, in async_migrate_entries
    ent_reg.async_update_entity(entry.entity_id, **updates)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity_registry.py", line 1179, in async_update_entity
    return self._async_update_entity(
           ~~~~~~~~~~~~~~~~~~~~~~~~~^
        entity_id,
        ^^^^^^^^^^
    ...<21 lines>...
        unit_of_measurement=unit_of_measurement,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/src/homeassistant/homeassistant/helpers/entity_registry.py", line 1118, in _async_update_entity
    raise ValueError(
    ...<2 lines>...
    )
ValueError: Unique id 'mifo_4177xxxxxx_over_frequency_load_reduction_switch' is already in use by 'switch.mifo_over_frequency_load_reduction'


EDIT: ignore, I think I have alot of old entities from previous maintainer. I'll delete it and try one more time

Deleted this two:
image

and now it's working again. Sorry.

@neofral
Copy link

neofral commented Dec 11, 2024

I had the same issue.
Deleted the device, deleted/uninstalled solarman from hacs, restarted HA.
Installed again the integration, restarted HA. after that i reconfigured my device.
All working fine after that

@davidrapan
Copy link
Owner

So it looks like migrations had conflicts w/ old entities huh?

@afkdk
Copy link

afkdk commented Dec 11, 2024

Then it is likely the custom integration that needs done update?

It certainly does not, this is issue w/ HA but if you install latest version issue will be gone because there isn't dependency on pysolarmav5 anymore.

You can read more 'bout this in #299

THANKS for this link that shows the challenge, history, and complexity (when changing the inner plumbing of Python in HA 🤯)

So nice to have this integration working again - APPRECIATE YOUR TIME AND THE GREAT WORK 👍😃

@gardiol
Copy link
Contributor

gardiol commented Dec 11, 2024

After today's update of Home Assistant, it seems broken again:

Logger: homeassistant.setup
Source: setup.py:334
First occurred: 6:25:19 PM (1 occurrences)
Last logged: 6:25:19 PM

Setup failed for custom integration 'solarman': Unable to import component: No module named 'pysolarmanv5'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 334, in _async_setup_component
    component = await integration.async_get_component()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1034, in async_get_component
    self._component_future.result()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1014, in async_get_component
    comp = await self.hass.async_add_import_executor_job(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        self._get_component, True
        ^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/local/lib/python3.13/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1074, in _get_component
    ComponentProtocol, importlib.import_module(self.pkg_path)
                       ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/util/loop.py", line 200, in protected_loop_func
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.13/importlib/__init__.py", line 88, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 1022, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "/config/custom_components/solarman/__init__.py", line 16, in <module>
    from .coordinator import Inverter, InverterCoordinator
  File "/config/custom_components/solarman/coordinator.py", line 11, in <module>
    from .api import Inverter
  File "/config/custom_components/solarman/api.py", line 16, in <module>
    from .include.pysolarmanv5 import PySolarmanV5Async, V5FrameError
  File "/config/custom_components/solarman/include/pysolarmanv5/__init__.py", line 4, in <module>
    from pysolarmanv5.pysolarmanv5 import PySolarmanV5
ModuleNotFoundError: No module named 'pysolarmanv5'

@gardiol
Copy link
Contributor

gardiol commented Dec 11, 2024

i updated to Core 2024.12.2 and noticed this after a few hours...

Cannot delete the device of course, because the integration is not starting...

@gardiol
Copy link
Contributor

gardiol commented Dec 11, 2024

I am responding to myself: i have reinstalled the integration manually from HACS control panel and it seems to be working. In case it happens to somebody else.

@davidrapan
Copy link
Owner

Yes, the error shows that you were not running the latest version.

@gardiol
Copy link
Contributor

gardiol commented Dec 11, 2024 via email

@davidrapan
Copy link
Owner

davidrapan commented Dec 11, 2024

HACS sometimes does that, not sure why.

Anyway, some more clarification:

from pysolarmanv5.pysolarmanv5 import PySolarmanV5

Still loads module and in the latest is:

from .pysolarmanv5 import PySolarmanV5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants