Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assertion error of Z-Wave firmware update #102027

Closed
EnochPrime opened this issue Oct 15, 2023 · 12 comments · Fixed by #103277
Closed

Assertion error of Z-Wave firmware update #102027

EnochPrime opened this issue Oct 15, 2023 · 12 comments · Fixed by #103277

Comments

@EnochPrime
Copy link

EnochPrime commented Oct 15, 2023

The problem

When clicking the install button on the z-wave firmware entity I receive an assertion error (see below). I am specifically attempting to update Inovelli VZW31-SN from firmware 1.0.0 to 1.2.

image

Z-Wave JS versions
zwave-js-ui: 9.1.2.a13a720
zwave-js: 12.0.4

What version of Home Assistant Core has the issue?

core-2023.10.3

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Container

Integration causing the issue

zwave_js

Link to integration documentation on our website

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

Diagnostics information

config_entry-zwave_js-45a7b9a2c861bb370dbe004ad2bc1017.json.txt

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Logger: homeassistant.components.websocket_api.http.connection
Source: components/websocket_api/commands.py:226
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 20:26:50 (1 occurrences)
Last logged: 20:26:50

[139697179835584]
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 226, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 2012, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2049, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 235, in handle_service
    return await service.entity_service_call(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 876, in entity_service_call
    response_data = await _handle_entity_call(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 948, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/update/__init__.py", line 157, in async_install
    await entity.async_install_with_progress(version, backup)
  File "/usr/src/homeassistant/homeassistant/components/update/__init__.py", line 432, in async_install_with_progress
    await self.async_install(version, backup)
  File "/usr/src/homeassistant/homeassistant/components/zwave_js/update.py", line 266, in async_install
    assert firmware
AssertionError


### Additional information

_No response_
@home-assistant
Copy link

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

Code owner commands

Code owners of zwave_js 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 zwave_js Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


zwave_js documentation
zwave_js source
(message by IssueLinks)

@raman325
Copy link
Contributor

hmm I'm not sure how that's possible. Out of curiosity, do you know if you did an HA restart in the time between when the update was available and when you clicked install? Wondering if the restore logic is faulty

@EnochPrime
Copy link
Author

do you know if you did an HA restart in the time between when the update was available and when you clicked install?

Yes, definitely. The update has been available for a while and I have restarted several times. Most recently I was using core-2023.10.1 and zwave-js-ui 9.0.3. I updated zwave-js-ui to 9.1.2 and attempted the update which failed with this error. I then updated to core-2023.10.3 and attempted again and received the same error.

@raman325
Copy link
Contributor

any chance you have access to the source for HA? I don't want to push an update just to add a logging statement for this issue, but I am curious what's happening on startup

@EnochPrime
Copy link
Author

any chance you have access to the source for HA? I don't want to push an update just to add a logging statement for this issue, but I am curious what's happening on startup

I did recently set up the dev environment and I have some experience with python. Just let me know where you need the debugging info.

@Lovski
Copy link

Lovski commented Oct 19, 2023

I've got this exact same issue when trying to update firmware for any Z-wave device. Running the latest HA via Docker and Z-wave JS UI via Docker in a separate container.

@EnochPrime
Copy link
Author

I checked again today and there is a description and the firmware is installing.

Screenshot_2023-10-20-22-18-48-94_c3a231c25ed346e59462e84656a70e50

@EnochPrime
Copy link
Author

Found some steps that seem to reproduce the issue. This assumes the description missing equates to the assertion error.

  1. Check updates and see description
  2. Navigate to Z-wave integration page and reload integration
  3. Check updates and see description is gone
  4. Restart Home Assistant
  5. Check updates and see descriptions have returned

@kpine
Copy link
Contributor

kpine commented Oct 31, 2023

@raman325 Could it be this code?

self._latest_version_firmware = (
ZWaveNodeFirmwareUpdateExtraStoredData.from_dict(
extra_data.as_dict()
).latest_version_firmware
)

All of my update entities have null values for latest_version_firmware. Example:

    {
      "state": {
        "entity_id": "update.left_garage_door_opener_firmware",
        "state": "off",
        "attributes": {
          "auto_update": false,
          "installed_version": "1.30.2",
          "in_progress": false,
          "latest_version": "1.30.2",
          "release_summary": null,
          "release_url": null,
          "skipped_version": null,
          "title": null,
          "device_class": "firmware",
          "entity_picture": "https://brands.home-assistant.io/_/zwave_js/icon.png",
          "friendly_name": "Left Garage Door Opener Firmware",
          "supported_features": 21
        },
        "last_changed": "2023-10-31T14:29:37.889782+00:00",
        "last_updated": "2023-10-31T14:29:37.889782+00:00",
        "context": {
          "id": "01HE327NZ16SQJTPJJQ0ST9V8G",
          "parent_id": null,
          "user_id": null
        }
      },
      "extra_data": {
        "latest_version_firmware": null
      },
      "last_seen": "2023-10-31T18:59:37.923847+00:00"
    }

@cgarwood
Copy link
Member

My prod system has null for extra_data.latest_version_firmware and gets the same error. I tested on my dev system and extra_data.latest_version_firmware was populated. When modifying core.restore_states on one of the entities and setting extra_data.latest_version_firmware to null and restarting HA, it breaks the same way as my prod system.

@KorvinSzanto
Copy link

I have this same issue with inovelli switches

@raman325
Copy link
Contributor

raman325 commented Nov 3, 2023

2023.11.1 should have the fix for this issue. Please let us know here if not, but no need to confirm it works, happy for this one to be out of sight out of mind if it does work 🙂

@github-actions github-actions bot locked and limited conversation to collaborators Dec 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants