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

Failed to set up #944

Closed
vejadutoo opened this issue May 18, 2024 · 4 comments
Closed

Failed to set up #944

vejadutoo opened this issue May 18, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@vejadutoo
Copy link

Alarmo Version

v1.10.1

HA Version

2024.5.4

Bug description

Alarmo gives error:
image
After updating to HA Core 2024.5.4 and Operating System 12.3.

Steps to reproduce

  • Updated HA Core and OS to 2024.5.4 and 12.3 respectively.
  • Uninstalled and Reinstalled Alarmo from HACS
  • Verified clean install of Alarmo by lack of alarmo folder in custom_components after the uninstall.

Relevant log output

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 575, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/alarmo/__init__.py", line 57, in async_setup_entry
    store = await async_get_registry(hass)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/alarmo/store.py", line 689, in async_get_registry
    return cast(AlarmoStorage, await task)
                               ^^^^^^^^^^
  File "/config/custom_components/alarmo/store.py", line 684, in _load_reg
    await registry.async_load()
  File "/config/custom_components/alarmo/store.py", line 314, in async_load
    data = await self._store.async_load()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/storage.py", line 287, in async_load
    return await load_task
           ^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/storage.py", line 296, in _async_load
    return await self._async_load_data()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/storage.py", line 401, in _async_load_data
    stored = await self._async_migrate_func(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/alarmo/store.py", line 292, in _async_migrate_func
    for sensorGroup in data["sensor_groups"]
                       ~~~~^^^^^^^^^^^^^^^^^
KeyError: 'sensor_groups'
@vejadutoo vejadutoo added the bug Something isn't working label May 18, 2024
@nielsfaber
Copy link
Owner

This seems caused by having a very old installation of Alarmo (more than 2 years old without making any changes) and trying to upgrade.
You should consider removing alarmo from the integrations page (should be possible by clicking on the 3 dots) and re-installing.

@vejadutoo
Copy link
Author

vejadutoo commented May 26, 2024

Hey @nielsfaber, thanks for taking the time to reply.

This seems caused by having a very old installation of Alarmo (more than 2 years old without making any changes) and trying to upgrade.

This is correct. I did try to upgrade a very old version in place initially. Unfortunately, I have no clue which one it was.

You should consider removing alarmo from the integrations page (should be possible by clicking on the 3 dots) and re-installing.

I did, I even did it multiple ways before I opened the issue.

  • I removed the integration, removed and re-installed alarmo from HACS
  • I did it again and restarted HASS before reinstalling, and again by removing everything and verifying the folder in custom_components was gone and restarting HASS then reinstalling.
  • Various permutations removing the integration, removing and reinstalling Alarmo, and restarting HASS.

There are also no references to Alarmo in my configuration.yaml and I removed all automation that referenced it.

Based on your note about upgrading from an old version, I did some more troubleshooting. I installed (and uninstalled) older versions of Alarmo from HACS and found the following:

  • 1.9.13 works
  • 1.9.14 or greater gives the same errors as above

@nielsfaber
Copy link
Owner

Uninstalling should remove the alarmo.storage file which is in the .storage subfolder in the HA directory. The files in the custom_components folder do not contain your installation files, so removing these files is not sufficient for removing the integration from HA.
If 1.9.13 works OK for you, I suggest to click the delete button under that version.
image
Afterwards you can update to the latest Alarmo version via HACS and add the integration again via HA.
I hope that works.

@vejadutoo
Copy link
Author

Well, I guess that was the one permutation I didn't try. That worked. Thank you!

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

2 participants