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

InvalidStateError: invalid state / KeyError: 'calendar' #67

Open
4 tasks done
daniele-athome opened this issue Sep 7, 2024 · 0 comments
Open
4 tasks done

InvalidStateError: invalid state / KeyError: 'calendar' #67

daniele-athome opened this issue Sep 7, 2024 · 0 comments

Comments

@daniele-athome
Copy link

System Health details

System Information

version core-2024.9.1
installation_type Home Assistant Core
dev false
hassio false
docker false
user homeassistant
virtualenv true
python_version 3.12.4
os_name Linux
os_version 6.7.12+bpo-amd64
arch x86_64
timezone Europe/Rome
config_dir /home/homeassistant/.homeassistant
Home Assistant Community Store
GitHub API ok
GitHub Content ok
GitHub Web ok
HACS Data ok
GitHub API Calls Remaining 5000
Installed Version 2.0.1
Stage running
Available Repositories 1397
Downloaded Repositories 43
Dashboards
dashboards 3
resources 25
views 8
mode yaml
Recorder
oldest_recorder_run 9 luglio 2024 alle ore 10:42
current_recorder_run 7 settembre 2024 alle ore 13:17
estimated_db_size 1946.98 MiB
database_engine mysql
database_version 10.11.6

Checklist

  • I have enabled debug logging for my installation.
  • I have filled out the issue template to the best of my ability.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This issue is not a duplicate issue of currently previous issues..

Describe the issue

I was editing the configuration of a chore helper (HA would probably remove the entity and recreate it maybe? It would explain why it is calling entity removal functions); UI showed it succedded, but then the helper started showing 'Unavailable' state and never recovered. Restarting fixed the issue: the helper started working again.

Reproduction steps

  1. Edit a chore helper configuration
  2. Save
  3. HA will show the entity as 'Unavailable'

Debug logs

set 07 13:20:20 scatola hass[2904472]: 2024-09-07 13:20:20.352 ERROR (MainThread) [homeassistant.components.sensor] Error while removing entity sensor.chore_water_closet1_clean
set 07 13:20:20 scatola hass[2904472]: Traceback (most recent call last):
set 07 13:20:20 scatola hass[2904472]:   File "/home/homeassistant/hass/lib/python3.12/site-packages/homeassistant/helpers/entity.py", line 1385, in async_remove
set 07 13:20:20 scatola hass[2904472]:     await self.__async_remove_impl(force_remove)
set 07 13:20:20 scatola hass[2904472]:   File "/home/homeassistant/hass/lib/python3.12/site-packages/homeassistant/helpers/entity.py", line 1401, in __async_remove_impl
set 07 13:20:20 scatola hass[2904472]:     await self.async_will_remove_from_hass()
set 07 13:20:20 scatola hass[2904472]:   File "/home/homeassistant/.homeassistant/custom_components/chore_helper/chore.py", line 156, in async_will_remove_from_hass
set 07 13:20:20 scatola hass[2904472]:     self.hass.data[const.DOMAIN][const.CALENDAR_PLATFORM].remove_entity(
set 07 13:20:20 scatola hass[2904472]:     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
set 07 13:20:20 scatola hass[2904472]: KeyError: 'calendar'
set 07 13:20:20 scatola hass[2904472]: During handling of the above exception, another exception occurred:
set 07 13:20:20 scatola hass[2904472]: Traceback (most recent call last):
set 07 13:20:20 scatola hass[2904472]:   File "/home/homeassistant/hass/lib/python3.12/site-packages/homeassistant/helpers/entity_platform.py", line 927, in async_reset
set 07 13:20:20 scatola hass[2904472]:     await entity.async_remove()
set 07 13:20:20 scatola hass[2904472]:   File "/home/homeassistant/hass/lib/python3.12/site-packages/homeassistant/helpers/entity.py", line 1390, in async_remove
set 07 13:20:20 scatola hass[2904472]:     self.__remove_future.set_result(None)
set 07 13:20:20 scatola hass[2904472]: asyncio.exceptions.InvalidStateError: invalid state

Diagnostics dump

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant