tomaae / homeassistant-portainer

Portainer integration for Home Assistant
Apache License 2.0
89 stars 7 forks source link

KeyError [Bug] #38

Open jonwaland opened 1 month ago

jonwaland commented 1 month ago

Describe the issue

Getting KeyError: errors in log

How to reproduce the issue

unknown

Expected behavior

no error

Screenshots

Software versions

Diagnostics data

none

Traceback/Error logs

2024-07-16 18:01:34.262 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved (None)
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/helpers/update_coordinator.py", line 255, in _handle_refresh_interval
    await self._async_refresh(log_failures=True, scheduled=True)
  File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/helpers/update_coordinator.py", line 411, in _async_refresh
    self.async_update_listeners()
  File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/helpers/update_coordinator.py", line 165, in async_update_listeners
    update_callback()
  File "/home/homeassistant/.homeassistant/custom_components/portainer/entity.py", line 114, in _handle_coordinator_update
    self._data = self.coordinator.data[self.description.data_path][self._uid]
                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
KeyError: 'bd807a5a7ce5d0b970d12819dd796593f9d9668a9e9faa3b370cbfa1c58aa372'

Additional context

none

tomaae commented 1 month ago

thats a strange one. can you post debugs?

jonwaland commented 1 month ago

I've restarted HA, and of course, the error has disappeared again. I've had it at occur multiple times (and then stop after a restart) about 3 times now. I'll set up debug and wait...

jonwaland commented 1 month ago

got a debug - apologies for size home-assistant_portainer_2024-07-19T02-07-20.232Z.log

PHeonix25 commented 1 month ago

This is happening for me near-constantly (roughly every 30 seconds: 5700 times in 48 hours). Happy to generate a debug log if it'll help.

For now, please feel free to add this screenshot to the original issue: image

github-actions[bot] commented 1 month ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

jonwaland commented 1 month ago

bump

jonwaland commented 3 weeks ago

OK - this error occurs when a container is removed (docker rm ....). the reported keyerror is the removed container.

github-actions[bot] commented 1 week ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

jonwaland commented 1 week ago

bump again