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
71.16k stars 29.84k forks source link

Matter device firmware update fails for multiple devices in parallel, or in sequence with Eve Thermo #125130

Closed FlySmack closed 3 days ago

FlySmack commented 1 week ago

The problem

Hi team,

Yesterday, Eve released firmware 3.5.0 for there Thread/Matter based Eve Thermo. The update itself works, but it fails in two scenarios: 1) Running multiple firmware updates in parallel 2) Starting firmware update, before the previously updated device is not yet reported as available by the Matter integration. If I wait until the previously updated device is reported as available again, then updating of the next device works.

Used Matter Server version: 6.4.2

I have 4 more Eve Thermo device ready to be updated, so I can reproduce the case and collecting additional data, or testing a different Matter Server version...

Error in the logs are:

2024-09-03 11:05:47.295 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [139816303911280] Unexpected exception
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/matter/update.py", line 222, in async_install
    await self.matter_client.update_node(
  File "/usr/local/lib/python3.12/site-packages/matter_server/client/client.py", line 536, in update_node
    await self.send_command(
  File "/usr/local/lib/python3.12/site-packages/matter_server/client/client.py", line 583, in send_command
    return await future
           ^^^^^^^^^^^^
matter_server.common.errors.UpdateError: Target node did not process the update file
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 241, in handle_call_service
    response = await hass.services.async_call(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2763, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2806, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 999, in entity_service_call
    single_response = await _handle_entity_call(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1071, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/update/__init__.py", line 154, in async_install
    await entity.async_install_with_progress(version, backup)
  File "/usr/src/homeassistant/homeassistant/components/update/__init__.py", line 458, in async_install_with_progress
    await self.async_install(version, backup)
  File "/usr/src/homeassistant/homeassistant/components/matter/update.py", line 229, in async_install
    raise HomeAssistantError(f"Error updating: {err}") from err
homeassistant.exceptions.HomeAssistantError: Error updating: Target node did not process the update file

What version of Home Assistant Core has the issue?

core-2024.8.3

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

Matter

Link to integration documentation on our website

https://www.home-assistant.io/integrations/matter/

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

2024-09-03 11:05:47.295 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [139816303911280] Unexpected exception
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/matter/update.py", line 222, in async_install
    await self.matter_client.update_node(
  File "/usr/local/lib/python3.12/site-packages/matter_server/client/client.py", line 536, in update_node
    await self.send_command(
  File "/usr/local/lib/python3.12/site-packages/matter_server/client/client.py", line 583, in send_command
    return await future
           ^^^^^^^^^^^^
matter_server.common.errors.UpdateError: Target node did not process the update file
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 241, in handle_call_service
    response = await hass.services.async_call(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2763, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2806, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 999, in entity_service_call
    single_response = await _handle_entity_call(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1071, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/update/__init__.py", line 154, in async_install
    await entity.async_install_with_progress(version, backup)
  File "/usr/src/homeassistant/homeassistant/components/update/__init__.py", line 458, in async_install_with_progress
    await self.async_install(version, backup)
  File "/usr/src/homeassistant/homeassistant/components/matter/update.py", line 229, in async_install
    raise HomeAssistantError(f"Error updating: {err}") from err
homeassistant.exceptions.HomeAssistantError: Error updating: Target node did not process the update file

Additional information

No response

home-assistant[bot] commented 1 week ago

Hey there @home-assistant/matter, mind taking a look at this issue as it has been labeled with an integration (matter) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `matter` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign matter` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


matter documentation matter source (message by IssueLinks)

agners commented 3 days ago

I was able to reproduce that issue, the problem is during setup of the OTA provider: Each OTA provider uses the same port (5540), which just can't work :see_no_evil:

This will be fixed with https://github.com/home-assistant-libs/python-matter-server/pull/885.