Closed RoboMagus closed 3 days ago
This appears to occur in the rename
event case on helpers.py line 394.
Here the taskcreated
variable is indeed referenced before assignment.
This bug would appear to be easily fixed by rewriting this code section as shown in the snippet below, however I do not know if removal of this check would have unintended side-effects.
if self._event_destroy:
await self._container_create_destroy()
# Second re-add the container with the original name
taskcreated = (
True
if self._event_create or self._event_destroy
else False
)
Thanks for reporting it, and I am not 100% anymore what that "if self._event_destroy and not taskcreated:" was intended for. You are right, changing It like you said, fixes the problem. I will commit it like that in the master, and we monitor how it goes (hopefully stable).
I released it officially in 1.19, all seem to be good.
I've recently started seeing the following log message:
Which on its own does not occur often (seems to be related to when containers are restarted / created / stopped), but it's followed by quite a lot (200+) of the following errors which appear to be caused by the incorrect handling of container creation / destruction indicated by the error above.
I'm running the latest version of
monitor_docker
, and2024.5.5
of HomeAssistant.