robinostlund / homeassistant-svk-mimer

Home assistant custom component for SVK Mimer
MIT License
8 stars 1 forks source link

Setup failed for custom integration 'svk_mimer' #19

Open mikael-andersson opened 4 days ago

mikael-andersson commented 4 days ago

HA software versions Core 2024.10.3 Supervisor 2024.10.2 Operating System 13.2 Frontend 20241002.3

I get the following error when installing svk_mimer version 0.1.6 manually in directory custom_components:

Logger: homeassistant.setup
Källa: setup.py:334
Inträffade först: 20 oktober 2024 kl. 13:35:31 (1 händelser)
Senast loggade: 20 oktober 2024 kl. 13:35:31

Setup failed for custom integration 'svk_mimer': Unable to import component: No module named 'aiosvkmimer'
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 1027, in async_get_component
    self._component_future.result()
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1007, in async_get_component
    comp = await self.hass.async_add_import_executor_job(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1067, 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.12/importlib/__init__.py", line 90, 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 995, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "/config/custom_components/svk_mimer/__init__.py", line 19, in <module>
    from aiosvkmimer.client import Mimer
ModuleNotFoundError: No module named 'aiosvkmimer'

After cleaning up svk_mimer references in .storage and restarting HA Core, I get this when I try to add the integration again:

image

This shows up in the HA Core log:

Logger: homeassistant.config_entries
Källa: config_entries.py:2945
Inträffade först: 09:24:31 (1 händelser)
Senast loggade: 09:24:31

Error occurred loading flow for integration svk_mimer: No module named 'aiosvkmimer'

I have been able to get this to work on another HA system, also by manually installing it, and do not get this error.

Just a few minutes ago I noticed that the manifest.json of version 0.16 has the following:

"requirements": []

while 0.1.5 has this:

    "requirements": [
        "aiosvkmimer==0.1.14"
    ],

Installing version 0.1.5 worked.

Why has the requirements changed?

I would very much appreciate any clarification on this, thanks.

robinostlund commented 4 days ago

Hi, Interesting, could be some issue with the pipeline that builds the package. I will see what i can find, thanks for reporting it.

mikael-andersson commented 3 days ago

Nice if you can look into it, thanks. Just let me know if you want me to test something or send you some logs.

robinostlund commented 3 days ago

How did you install the package? If you clone the repository and copy the content to your custom_components folder it won't work as when i trigger new releases it generates the manifest files automatically.

If i download the latest release from here: https://github.com/robinostlund/homeassistant-svk-mimer/releases/download/v0.1.6/svkmimer.zip i can see that the manifest looks like this which looks correct:

{
    "domain": "svk_mimer",
    "name": "SVK Mimer",
    "after_dependencies": [
        "http"
    ],
    "codeowners": [
        "@robinostlund"
    ],
    "config_flow": true,
    "dependencies": [],
    "documentation": "https://github.com/robinostlund/homeassistant-svk-mimer/",
    "iot_class": "cloud_polling",
    "issue_tracker": "https://github.com/robinostlund/homeassistant-svk-mimer/issues",
    "requirements": [
        "aiosvkmimer==0.1.14"
    ],
    "version": "v0.1.6"
}

Check this file: https://github.com/robinostlund/homeassistant-svk-mimer/blob/master/manage/update_manifest.py

mikael-andersson commented 3 days ago

Yes, I hade cloned the repo. :) Ok, great, now I understand, many thanks for explaining this. Maybe you can add some short explanation in the README to newbies like me. :) For example:

Manual installation

Make sure to download the zip archive svkmimer.zip and not any of the compressed archives containing the Source code, nor by cloning the repository.

I think you can close this issue then. Thanks for a great component, especially now when it should work for me! :)