nielsfaber / alarmo

Easy to use alarm system integration for Home Assistant
1.33k stars 121 forks source link

Alarmo-integration will not be loaded after update from Alarmo v1.10.3 to v1.10.4 #988

Closed tackin closed 1 month ago

tackin commented 3 months ago

Checklist

Alarmo Version

v1.10.4

HA Version

2024.6.2

Bug description

I just updated Alarmo via HACS in HA 2024.6.2. After restart of HA the Alarmo-integration could not be started. Please see uploaded log.

Steps to reproduce

Updated the integration from v1.10.3 to v 1.10.4 in HA 2024.6.2

Relevant log output

Logger: homeassistant.setup
Quelle: setup.py:320
Erstmals aufgetreten: 21:04:34 (1 Vorkommnisse)
Zuletzt protokolliert: 21:04:34

Setup failed for custom integration 'alarmo': Unable to import component: cannot import name 'StaticPathConfig' from 'homeassistant.components.http' (/usr/src/homeassistant/homeassistant/components/http/__init__.py)
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/loader.py", line 992, 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 1052, in _get_component
    ComponentProtocol, importlib.import_module(self.pkg_path)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/util/loop.py", line 131, 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/alarmo/__init__.py", line 29, in <module>
    from .panel import (
  File "/config/custom_components/alarmo/panel.py", line 6, in <module>
    from homeassistant.components.http import StaticPathConfig
ImportError: cannot import name 'StaticPathConfig' from 'homeassistant.components.http' (/usr/src/homeassistant/homeassistant/components/http/__init__.py)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 320, in _async_setup_component
    component = await integration.async_get_component()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1012, in async_get_component
    self._component_future.result()
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1004, in async_get_component
    comp = self._get_component()
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1052, in _get_component
    ComponentProtocol, importlib.import_module(self.pkg_path)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/util/loop.py", line 131, 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/alarmo/__init__.py", line 29, in <module>
    from .panel import (
  File "/config/custom_components/alarmo/panel.py", line 6, in <module>
    from homeassistant.components.http import StaticPathConfig
ImportError: cannot import name 'StaticPathConfig' from 'homeassistant.components.http' (/usr/src/homeassistant/homeassistant/components/http/__init__.py)
nielsfaber commented 3 months ago

Sorry, this version contains changes that requires updating to HA 2024.7.

tackin commented 3 months ago

.... And I was so 100% sure it will work, because you were so strict last time in requesting 2024.6 ;-)

tackin commented 3 months ago

Confirmed! Update to HA 2024.7 fixed the problem.

simonepittis commented 3 months ago

I made the upgrade to v1.10.4 and the upgrade to core-2024.7.0... but HA go in Recovey mode. for me it's not fixed

loryanstrant commented 3 months ago

Ah yep, same problem here. Don't know why I updated it when I don't have 2024.7 installed and wasn't planning on it until at least .1 was available.

ajavibp commented 3 months ago

Sorry for the offtopic, but what image do you have so that it can be updated quickly. I use the stable official, ghcr.io/home-assistant/home-assistant:stable, and it's still in version 2024.6.4. Thanks

nielsfaber commented 3 months ago

@ajavibp this is not true. HA 2024.7 was released last night (same as alarmo release). Your link shows this as well.

ajavibp commented 3 months ago

l It was finally updated and now works perfectly. Thank you

smarthomefamilyverrips commented 3 months ago

Sorry, this version contains changes that requires updating to HA 2024.7.

@nielsfaber why this was not noted in changelog? What to do now can I rollback and redownload 10.3 from HACS?

nielsfaber commented 3 months ago

@smarthomefamilyverrips I only test alarmo with the latest HA version, it’s your own choice (and responsibility) to only update one without the other. HA changes a lot of things between their releases, so I have no idea about backwards compatibility. However HACS should state which HA version is required for a certain alarmo release update, at least this information is provided to HACS via this file: https://github.com/nielsfaber/alarmo/blob/main/hacs.json I do not know the procedure for rollback via HACS, but the files for manual installation of all releases ever published remain available for download in this repository.

smarthomefamilyverrips commented 3 months ago

@smarthomefamilyverrips I only test alarmo with the latest HA version, it’s your own choice (and responsibility) to only update one without the other. HA changes a lot of things between their releases, so I have no idea about backwards compatibility. However HACS should state which HA version is required for a certain alarmo release update, at least this information is provided to HACS via this file: https://github.com/nielsfaber/alarmo/blob/main/hacs.json I do not know the procedure for rollback via HACS, but the files for manual installation of all releases ever published remain available for download in this repository.

@nielsfaber Well unfortunately it not did state anywhere that 2024.7 was needed nor I got any message from HACS about this when I updated from.the notification of a new version of alarmo within HACS

smarthomefamilyverrips commented 3 months ago

Screenshot_20240704_211128_Home Assistant

@nielsfaber from where should see 2024.7 is needed, HACS just prompts me there is a update, and also let's me do the update... I did re-download 10.3 and seems to work, hope it not will cause any problems in near future.

nielsfaber commented 3 months ago

@smarthomefamilyverrips I don't know how HACS deals with this. From Alarmo's side I just provide the property, which is described as 'The minimum required Home Assistant version.' (see https://hacs.xyz/docs/publish/start#hacsjson), so HACS should be able to prevent you from updating to an incompatible release - but apparently it doesn't.

tackin commented 3 months ago

Might be, because the bump in your hacs.json to 2024.7.0 was NOT in the Release-Commit itself but was done later in an additional commit. In between HACS "saw" a new Release with "required HA-verson" still at "2024.6.0". So HACS might not be to blame.

nielsfaber commented 3 months ago

@tackin You may have a point there. I have no idea how HACS works under the hood, but what you're saying makes sense. I will try to remember to update the file before the next release (in case of a breaking change) and test if it works like you describe. Thanks for the pointer 👍

thomluther commented 3 months ago

@nielsfaber Hacs first looks at tags (releases) and the one selected in HA will be installed. If you committed a requirement change later to main, you have to create another release to get that included in HACS installs.

BTW, when you switch HACS to experimental mode, it will create update entities for each integration. Then you can use the update install service, select the alarmo entity and provide any release or branch name to install. It can also install older releases through the service or the 'main' branch. Very usefull if you have beta code just on a branch that you want to test through HACS before you create a release.

Edit: I just confirmed that I get the requirement error when trying to install 'main' branch on my HA 2024.6

Vaarlion commented 3 months ago

I got bitten by this to, now downgrading to the 1.10.3.

I know HACS hide release that aren't compatible usually so i didn't check, mistake happens. Thank for this post, i could find it quickly :)

Also, please don't talk down to people who wait for ha release to be stable before pushing them to their home. Not everyone is in the same boat, and some may want to wait for the couple bug-fix every month to be release before updating :)

vdiogo commented 3 months ago

Got the same error and updating to HomeAssistant 2024.7.1 fixed it.

thomluther commented 3 months ago

Yeah, I think it will be helpful to cut another release from actual main, because when installing from main branch, I get the min required HA version error and it does not install on HA 2024.06. This is the expected behavior when the min HA version is set accordingly in the hacs.json file.

github-actions[bot] commented 1 month ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days