readme icon indicating copy to clipboard operation
readme copied to clipboard

Error HA 2025.5

Open jphoke opened this issue 6 months ago • 6 comments

I don't know if this started with 2025.5 or 2025.5.1

Version of the custom_component

v0.5.0 (HACS Installed)

Configuration

N/A

Add your logs here.

Source: custom_components/readme/__init__.py:192
integration: Home Assistant WebSocket API ([documentation](https://www.home-assistant.io/integrations/websocket_api), [issues](https://github.com/home-assistant/core/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+websocket_api%22))
First occurred: 7:44:33 PM (3 occurrences)
Last logged: 7:47:47 PM

[140088480710880] Error handling message: Unknown error (unknown_error) John Hoke from 127.0.0.1 (Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.4 Safari/605.1.15)
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 28, in _handle_async_response
    await func(hass, connection, msg)
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 821, in handle_execute_script
    script_result = await script_obj.async_run(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
        msg.get("variables"), context=context
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1836, in async_run
    return await asyncio.shield(create_eager_task(run.async_run()))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 460, in async_run
    await self._async_step(log_exceptions=False)
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 526, in _async_step
    self._handle_exception(
    ~~~~~~~~~~~~~~~~~~~~~~^
        ex, continue_on_error, self._log_exceptions or log_exceptions
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 556, in _handle_exception
    raise exception
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 524, in _async_step
    await getattr(self, handler)()
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1012, in _async_step_call_service
    response_data = await self._async_run_long_action(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<9 lines>...
    )
    ^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 624, in _async_run_long_action
    return await long_task
           ^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2802, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2845, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/readme/__init__.py", line 155, in service_generate
    installed_addons = get_ha_installed_addons(hass)
  File "/config/custom_components/readme/__init__.py", line 192, in get_ha_installed_addons
    if not hass.components.hassio.is_hassio():
           ^^^^^^^^^^^^^^^
AttributeError: 'HomeAssistant' object has no attribute 'components'
## Describe the bug
A clear and concise description of what the bug is.


When choosing Dev Tools > Actions > Generate Readme: Generate it throws an "Unknown Error" with the above in the log file

jphoke avatar May 09 '25 23:05 jphoke

This did start with 2025.5.0 (it has been logged for almost a year that it would stop).

ludeeus avatar May 12 '25 07:05 ludeeus

Try the 0.6.0b0 release. https://github.com/custom-components/readme/releases/tag/0.6.0b0

ludeeus avatar Jun 11 '25 04:06 ludeeus

Hey @ludeeus, I just tested the new pre-release and it's working with latest HA (2025.6.1). Anyway I noticed that addons are not retrieved anymore, and the template

### Add-ons
{%- for addon in addons | sort(attribute='name') %}
- {{addon.name}}
{%- endfor %}

Does not print any.

I guess something has changed in the homeassistant.components.hassio get_supervisor_info function?

aronnebrivio avatar Jun 14 '25 12:06 aronnebrivio

I guess this is the issue: https://github.com/custom-components/readme/commit/5383a5d9125e2bd3d421dfb93f82eca49c848ba0#diff-67a584e3b8c7a0793bf5fb5848b8396d0e35df0add0846b84705057329fcd5a5L192

Image

In the refactoring a not was lost, making the function returning an empty list for all hassio installations.

I opened a PR to fix it: https://github.com/custom-components/readme/pull/38

aronnebrivio avatar Jun 21 '25 10:06 aronnebrivio

I tried 0.5.0 and got the original error, redownloaded the 0.6.0b1 pre-release version and it appears to be working for me.

donutz avatar Jul 28 '25 19:07 donutz

Same here, 0.5.0 : AttributeError: 'HomeAssistant' object has no attribute 'components' , 0.6.0b1 pre-release : works without issue

Maxklos avatar Sep 24 '25 08:09 Maxklos