nielsfaber/scheduler-component

Dictionary changed size during iteration

Miguelguilherme opened this issue · 6 comments

For the last few days, all my shedule with "light" entities are presenting the following error:
_Exception in async_timer_updated when dispatching 'scheduler_timer_updated': ('4bad81',) Traceback (most recent call last): File "/config/custom_components/scheduler/switch.py", line 251, in async_timer_updated await self._action_handler.async_queue_actions( File "/config/custom_components/scheduler/actions.py", line 260, in async_queue_actions for queue in self.queues.values(): RuntimeError: dictionary changed size during iteration

Also detected that, if they have multiple entities, will only control the first entity to be called.

(have a couple of "cover" entities and they present no errors)

Hello,
Same problem since updating to 2024.4 beta.

that's it! I'm also on beta channel.

just updated to 2024.4.0b4 and the problem persists. will also report to HA

HA answer:
This is an issue in the scheduler custom integration. Please report it at their issue tracker.

I see different errors.
On changing a schedule for climate target temperature:

2024-04-02 19:47:00.483 ERROR (MainThread) [homeassistant.util.logging] Exception in async_timer_updated when dispatching 'scheduler_timer_updated': ('8ca26b',)
Traceback (most recent call last):
  File "/home/homeassi/.homeassistant/custom_components/scheduler/switch.py", line 251, in async_timer_updated
    await self._action_handler.async_queue_actions(
  File "/home/homeassi/.homeassistant/custom_components/scheduler/actions.py", line 260, in async_queue_actions
    for queue in self._queues.values():
RuntimeError: dictionary changed size during iteration

When the schedule fires:

2024-04-02 19:50:00.011 ERROR (MainThread) [homeassistant.util.logging] Exception in async_timer_finished when dispatching 'scheduler_timer_finished': ('8ca26b',)
Traceback (most recent call last):
  File "/home/homeassi/.homeassistant/custom_components/scheduler/switch.py", line 278, in async_timer_finished
    await self._action_handler.async_queue_actions(
  File "/home/homeassi/.homeassistant/custom_components/scheduler/actions.py", line 260, in async_queue_actions
    for queue in self._queues.values():
RuntimeError: dictionary changed size during iteration

The schedule seems to work, target temperature gets changed.

I just made release v3.3.3 that should fix this error message.

fixed! many thanks!