hassio-addons / addon-appdaemon

AppDaemon4 - Home Assistant Community Add-ons
https://addons.community
MIT License
156 stars 48 forks source link

No AppDaemon UI after last version installation. #334

Closed kolchanov closed 6 months ago

kolchanov commented 6 months ago

Problem/Motivation

Can't open AppDaemon UI after last version installation.

Expected behavior

AppDaemon UI is accessable.

Actual behavior

No AppDaemon listener is started and I see errors in log^

Home Assistant Supervisor: 2024.03.0


Please, share the above information when looking for help or support in, e.g., GitHub, forums or the Discord chat.


..... 2024-03-22 09:31:42.950124 WARNING HASS: Error getting services - retrying Task exception was never retrieved future: <Task finished name='Task-93' coro=<HassPlugin.run_hass_service_check() done, defined at /usr/lib/python3.11/site-packages/appdaemon/plugins/hass/hassplugin.py:763> exception=ClientResponseError(RequestInfo(url=URL('http://supervisor/core/api/services'), method='GET', headers=<CIMultiDictProxy('Host': 'supervisor', 'x-ha-access': 'fbfa15f76ad79f677aa9d055f5d1e689dc65290f15ba7d2af26e59b8174646ba2d7ac0d35f9d581120db22d520b3fabca840f2fa93734044', 'Accept': '/', 'Accept-Encoding': 'gzip, deflate', 'User-Agent': 'Python/3.11 aiohttp/3.8.6')>, real_url=URL('http://supervisor/core/api/services')), (), status=502, message='Bad Gateway', headers=<CIMultiDictProxy('Content-Type': 'text/plain; charset=utf-8', 'Content-Length': '16', 'Date': 'Fri, 22 Mar 2024 08:31:42 GMT', 'Server': 'Python/3.12 aiohttp/3.9.3')>)> Traceback (most recent call last): File "/usr/lib/python3.11/site-packages/appdaemon/plugins/hass/hassplugin.py", line 772, in run_hass_service_check hass_services = await self.get_hass_services() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/site-packages/appdaemon/plugins/hass/hassplugin.py", line 732, in get_hass_services r.raise_for_status() File "/usr/lib/python3.11/site-packages/aiohttp/client_reqrep.py", line 1011, in raise_for_status raise ClientResponseError( aiohttp.client_exceptions.ClientResponseError: 502, message='Bad Gateway', url=URL('http://supervisor/core/api/services') 2024-03-22 09:31:45.811785 INFO HASS: Connected to Home Assistant 2024.3.1 2024-03-22 09:31:45.898074 INFO HASS: Evaluating startup conditions 2024-03-22 09:31:45.923808 INFO HASS: Startup condition met: hass state=RUNNING 2024-03-22 09:31:45.924224 INFO HASS: All startup conditions met 2024-03-22 09:31:45.955162 INFO AppDaemon: Processing restart for HASS 2024-03-22 09:31:45.955718 INFO AppDaemon: Terminating hello_world 2024-03-22 09:31:45.957501 INFO AppDaemon: Reloading Module: /config/apps/hello.py 2024-03-22 09:31:45.958947 INFO AppDaemon: Loading app hello_world using class HelloWorld from module hello 2024-03-22 09:31:45.960135 INFO AppDaemon: Calling initialize() for hello_world 2024-03-22 09:31:45.961311 INFO hello_world: Hello from AppDaemon 2024-03-22 09:31:45.961878 INFO hello_world: You are now ready to run Apps! 2024-03-22 09:32:06.870782 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds 2024-03-22 09:32:11.876565 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds 2024-03-22 09:32:16.880931 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds 2024-03-22 09:32:21.886143 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds 2024-03-22 09:32:28.600604 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds 2024-03-22 09:32:33.609929 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds 2024-03-22 09:32:38.624367 INFO HASS: Connected to Home Assistant 2024.3.1 2024-03-22 09:32:38.687851 INFO HASS: Evaluating startup conditions 2024-03-22 09:32:38.697567 INFO HASS: Startup condition met: hass state=RUNNING 2024-03-22 09:32:38.697932 INFO HASS: All startup conditions met 2024-03-22 09:32:38.721230 INFO AppDaemon: Processing restart for HASS 2024-03-22 09:32:38.721602 INFO AppDaemon: Terminating hello_world 2024-03-22 09:32:38.722327 INFO AppDaemon: Reloading Module: /config/apps/hello.py 2024-03-22 09:32:38.723637 INFO AppDaemon: Loading app hello_world using class HelloWorld from module hello 2024-03-22 09:32:38.725138 INFO AppDaemon: Calling initialize() for hello_world 2024-03-22 09:32:38.726050 INFO hello_world: Hello from AppDaemon 2024-03-22 09:32:38.726632 INFO hello_world: You are now ready to run Apps!

Steps to reproduce

Install latest versions of AppDaemon

kolchanov commented 6 months ago

Additional investigation results: UI is not opening if I log to https://public.domain:8123 and is opening when I log to https://homeassistant.local:8123 In this case AppDomain ui has no secure http://homeassistant.local:5050/ url

frenck commented 6 months ago

This log:

File "/usr/lib/python3.11/site-packages/appdaemon/plugins/hass/hassplugin.py", line 732, in get_hass_services
r.raise_for_status()
File "/usr/lib/python3.11/site-packages/aiohttp/client_reqrep.py", line 1011, in raise_for_status
raise ClientResponseError(
aiohttp.client_exceptions.ClientResponseError: 502, message='Bad Gateway', url=URL('http://supervisor/core/api/services')

Upstream Home Assistant isn't available at this point (maybe starting or restarting?), as it throws an 502. Seems like AppDaemon isn't handling this. This is not an add-on issue.

../Frenck