appdaemon icon indicating copy to clipboard operation
appdaemon copied to clipboard

"Task exception was never retrieved" in run_hass_service_check()

Open electrofloat opened this issue 2 years ago • 1 comments

What happened?

When HA is not available there's a traceback in the log stating:

May  6 10:43:45 localhost python3[4624]: Task exception was never retrieved
May  6 10:43:45 localhost python3[4624]: future: <Task finished name='Task-18249868' coro=<HassPlugin.run_hass_service_check() done, defined at /home/homeassistant/appdaemon/lib/python3.10/site-packages/appdaemon/plugins/hass/hassplugin.py:751> exception=ClientResponseError(RequestInfo(url=URL('https://ha.domain.tld/api/services'), method='GET', headers=<CIMultiDictProxy('Host': 'ha.domain.tld', 'Authorization': 'Bearer Bearertoken', 'Accept': '*/*', 'Accept-Encoding': 'gzip, deflate', 'User-Agent': 'Python/3.10 aiohttp/3.8.4')>, real_url=URL('https://ha.domain.tld/api/services')), (), status=502, message='Bad Gateway', headers=<CIMultiDictProxy('Date': 'Sat, 06 May 2023 08:43:45 GMT', 'Content-Type': 'text/html', 'Content-Length': '150', 'Connection': 'keep-alive')>)>
May  6 10:43:45 localhost python3[4624]: Traceback (most recent call last):
May  6 10:43:45 localhost python3[4624]:   File "/home/homeassistant/appdaemon/lib/python3.10/site-packages/appdaemon/plugins/hass/hassplugin.py", line 760, in run_hass_service_check
May  6 10:43:45 localhost python3[4624]:     hass_services = await self.get_hass_services()
May  6 10:43:45 localhost python3[4624]:   File "/home/homeassistant/appdaemon/lib/python3.10/site-packages/appdaemon/plugins/hass/hassplugin.py", line 722, in get_hass_services
May  6 10:43:45 localhost python3[4624]:     r.raise_for_status()
May  6 10:43:45 localhost python3[4624]:   File "/home/homeassistant/appdaemon/lib/python3.10/site-packages/aiohttp/client_reqrep.py", line 1005, in raise_for_status
May  6 10:43:45 localhost python3[4624]:     raise ClientResponseError(
May  6 10:43:45 localhost python3[4624]: aiohttp.client_exceptions.ClientResponseError: 502, message='Bad Gateway', url=URL('https://ha.domain.tld/api/services')

Version

4.2.3

Installation type

Python virtual environment

Relevant log output

May  6 10:43:45 localhost python3[4624]: Task exception was never retrieved
May  6 10:43:45 localhost python3[4624]: future: <Task finished name='Task-18249868' coro=<HassPlugin.run_hass_service_check() done, defined at /home/homeassistant/appdaemon/lib/python3.10/site-packages/appdaemon/plugins/hass/hassplugin.py:751> exception=ClientResponseError(RequestInfo(url=URL('https://ha.domain.tld/api/services'), method='GET', headers=<CIMultiDictProxy('Host': 'ha.domain.tld', 'Authorization': 'Bearer bearertoken', 'Accept': '*/*', 'Accept-Encoding': 'gzip, deflate', 'User-Agent': 'Python/3.10 aiohttp/3.8.4')>, real_url=URL('https://ha.domain.tld/api/services')), (), status=502, message='Bad Gateway', headers=<CIMultiDictProxy('Date': 'Sat, 06 May 2023 08:43:45 GMT', 'Content-Type': 'text/html', 'Content-Length': '150', 'Connection': 'keep-alive')>)>
May  6 10:43:45 localhost python3[4624]: Traceback (most recent call last):
May  6 10:43:45 localhost python3[4624]:   File "/home/homeassistant/appdaemon/lib/python3.10/site-packages/appdaemon/plugins/hass/hassplugin.py", line 760, in run_hass_service_check
May  6 10:43:45 localhost python3[4624]:     hass_services = await self.get_hass_services()
May  6 10:43:45 localhost python3[4624]:   File "/home/homeassistant/appdaemon/lib/python3.10/site-packages/appdaemon/plugins/hass/hassplugin.py", line 722, in get_hass_services
May  6 10:43:45 localhost python3[4624]:     r.raise_for_status()
May  6 10:43:45 localhost python3[4624]:   File "/home/homeassistant/appdaemon/lib/python3.10/site-packages/aiohttp/client_reqrep.py", line 1005, in raise_for_status
May  6 10:43:45 localhost python3[4624]:     raise ClientResponseError(
May  6 10:43:45 localhost python3[4624]: aiohttp.client_exceptions.ClientResponseError: 502, message='Bad Gateway', url=URL('https://ha.domain.tld/api/services')

Relevant code in the app or config file that caused the issue

No response

Anything else?

No response

electrofloat avatar May 06 '23 08:05 electrofloat

This is not exactly a bug as can be any of the regular calls to HA. It just says HA is unavailable, so needs fixing. Even if you given the app or service call, it will most likely be from the plugin which makes the calls.

but out of curiosity, why do you want to know which app caused it?

Odianosen25 avatar Jun 29 '23 04:06 Odianosen25