Task exception was never retrieved / Attribute error

Hello everybody!

I have an error message for a few weeks now, and can’t pinpoint it on any specific integration, so I could do something about it. The error is this:

Logger: homeassistant
Source: util/logging.py:207
First occurred: 13:05:22 (10 occurrences)
Last logged: 13:19:31

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/util/logging.py", line 185, in coro_wrapper
    return await target
           ^^^^^^^^^^^^
TypeError: object NoneType can't be used in 'await' expression

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/util/logging.py", line 187, in coro_wrapper
    log_exception(format_err, *args)
  File "/usr/src/homeassistant/homeassistant/util/logging.py", line 115, in log_exception
    friendly_msg = format_err(*args)
                   ^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/util/logging.py", line 207, in <lambda>
    target.__name__,
    ^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute '__name__'

Does anybody have an idea to what integration this error message belongs? I have a feeling it could be “Spook”, but that’s only because it was the last “new” integration I activated.

I have searched for coro_wrapper, but this doesn’t get me any further. Neither searching for __name__.

Any ideas on how to start debugging this would be very much appreciated. I already thought about enabling debug for all integrations, but as this will likely need hours to read through all that logs, I thought I’ll ask first, if someone can push me into the right direction. :slight_smile:

Thanks in advance! :slight_smile:

Bump… :slight_smile:

Nobody? :blush: Not even a slight idea where this could come from? Or how I could find out, where it comes from? :slight_smile:

Thanks! :slight_smile:

I have a similar issue.
These issues errors keep appearing with zigpy as a source but they don’t always link to that. Example below.

Logger: homeassistant
Source: /usr/src/homeassistant/homeassistant/runner.py:143
First occurred: 14:09:08 (8 occurrences)
Last logged: 22:23:05

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/zigpy_znp/api.py", line 1028, in request
    response = await response_future
               ^^^^^^^^^^^^^^^^^^^^^
asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/zigpy_znp/api.py", line 1067, in request_callback_rsp
    await self.request(request, timeout=timeout, **response_params)
  File "/usr/local/lib/python3.11/site-packages/zigpy_znp/api.py", line 1024, in request
    async with async_timeout.timeout(
  File "/usr/local/lib/python3.11/site-packages/async_timeout/__init__.py", line 141, in __aexit__
    self._do_exit(exc_type)
  File "/usr/local/lib/python3.11/site-packages/async_timeout/__init__.py", line 228, in _do_exit
    raise asyncio.TimeoutError
TimeoutError

Same exact error as @rodgorlabach. Seems to be a bug in ZHA with TI ZNP chips. Might be a while before it’s fixed.