home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
69.75k stars 28.91k forks source link

RuntimeWarning: coroutine 'Entity.async_update_ha_state' was never awaited handle = self._ready.popleft() #110082

Closed andrewjswan closed 3 months ago

andrewjswan commented 4 months ago

The problem

Lots of warnings in the log like:

2024-02-09 00:32:57.788 WARNING (MainThread) [py.warnings] /usr/local/lib/python3.12/asyncio/base_events.py:1959: RuntimeWarning: coroutine 'Entity.async_update_ha_state' was never awaited
  handle = self._ready.popleft()

What version of Home Assistant Core has the issue?

core-2024.1.0

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

No response

Link to integration documentation on our website

No response

Diagnostics information

2024-02-09 00:26:56.049 WARNING (MainThread) [py.warnings] /usr/local/lib/python3.12/asyncio/base_events.py:1959: RuntimeWarning: coroutine 'Entity.async_update_ha_state' was never awaited
  handle = self._ready.popleft()

2024-02-09 00:28:56.308 WARNING (MainThread) [py.warnings] /usr/local/lib/python3.12/asyncio/base_events.py:1959: RuntimeWarning: coroutine 'Entity.async_update_ha_state' was never awaited
  handle = self._ready.popleft()

2024-02-09 00:30:57.288 WARNING (MainThread) [py.warnings] /usr/local/lib/python3.12/asyncio/base_events.py:1959: RuntimeWarning: coroutine 'Entity.async_update_ha_state' was never awaited
  handle = self._ready.popleft()

2024-02-09 00:32:57.788 WARNING (MainThread) [py.warnings] /usr/local/lib/python3.12/asyncio/base_events.py:1959: RuntimeWarning: coroutine 'Entity.async_update_ha_state' was never awaited
  handle = self._ready.popleft()

2024-02-09 00:34:58.906 WARNING (MainThread) [py.warnings] /usr/local/lib/python3.12/asyncio/base_events.py:1959: RuntimeWarning: coroutine 'Entity.async_update_ha_state' was never awaited
  handle = self._ready.popleft()

2024-02-09 00:36:59.045 WARNING (MainThread) [py.warnings] /usr/local/lib/python3.12/asyncio/base_events.py:1959: RuntimeWarning: coroutine 'Entity.async_update_ha_state' was never awaited
  handle = self._ready.popleft()

2024-02-09 00:38:59.665 WARNING (MainThread) [py.warnings] /usr/local/lib/python3.12/asyncio/base_events.py:1959: RuntimeWarning: coroutine 'Entity.async_update_ha_state' was never awaited
  handle = self._ready.popleft()

2024-02-09 00:41:00.652 WARNING (MainThread) [py.warnings] /usr/local/lib/python3.12/asyncio/base_events.py:1959: RuntimeWarning: coroutine 'Entity.async_update_ha_state' was never awaited
  handle = self._ready.popleft()

2024-02-09 00:43:01.104 WARNING (MainThread) [py.warnings] /usr/local/lib/python3.12/asyncio/base_events.py:1959: RuntimeWarning: coroutine 'Entity.async_update_ha_state' was never awaited
  handle = self._ready.popleft()

2024-02-09 00:45:01.422 WARNING (MainThread) [py.warnings] /usr/local/lib/python3.12/asyncio/base_events.py:1959: RuntimeWarning: coroutine 'Entity.async_update_ha_state' was never awaited
  handle = self._ready.popleft()

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

joostlek commented 4 months ago

Can you try booting in safe mode to check if that makes the warnings go away

andrewjswan commented 4 months ago

I'll try and let you know.

andrewjswan commented 4 months ago

I restarted, got other errors, but after 15 minutes of working in the safe mod, I couldn’t find this one.

joostlek commented 4 months ago

That means there is a custom integration that is causing this

zollak commented 3 months ago

Hi, I understood it might come from a custom integration. I've found this writeup regarding the issue itself: https://superfastpython.com/asyncio-coroutine-was-never-awaited/

Could you please help to find somehow the rootcause? I might need more verbose log where I can find the exact integration.

Btw, I also have this issue. I have the following custom integrations: hacs, mikrotik_router, comfoconnect, samsungtv_smart, gree, nodered, localtuya, alarmo @andrewjswan If you don't have all of these, that would narrow the circle.

andrewjswan commented 3 months ago

Of these I only have gree, localtuya, hacs

joostlek commented 3 months ago

Is this issue solved for you btw?

andrewjswan commented 3 months ago

No

joostlek commented 3 months ago

Closing anyway since we established that this is happening in a custom integration