homeassistant-truenas: [Bug] Exception in update_controller when dispatching 'truenas-update-TrueNAS'

Describe the issue

I’m not sure if this has been reported or not, but HA 2023.9 this integration stops working entirely for me with this error logged over and over again

Source: util/logging.py:168
First occurred: 00:07:36 (3453 occurrences)
Last logged: 19:14:50

Exception in update_controller when dispatching 'truenas-update-TrueNAS': () Traceback (most recent call last): File "/config/custom_components/truenas/model.py", line 33, in update_controller model_update_items( File "/config/custom_components/truenas/model.py", line 86, in model_update_items if tmp := _register_entity(sensors, item_id, "", uid_sensor): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/truenas/model.py", line 60, in _register_entity _sensors[_item_id].async_schedule_update_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 901, in async_schedule_update_ha_state self.async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 707, in async_write_ha_state raise RuntimeError(f"Attribute hass is None for {self}") RuntimeError: Attribute hass is None for <Entity Uptime>
Exception in update_controller when dispatching 'truenas-update-TrueNAS': () Traceback (most recent call last): File "/config/custom_components/truenas/model.py", line 33, in update_controller model_update_items( File "/config/custom_components/truenas/model.py", line 93, in model_update_items if tmp := _register_entity(sensors, item_id, uid, uid_sensor): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/truenas/model.py", line 60, in _register_entity _sensors[_item_id].async_schedule_update_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 901, in async_schedule_update_ha_state self.async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 707, in async_write_ha_state raise RuntimeError(f"Attribute hass is None for {self}") RuntimeError: Attribute hass is None for <entity None=on>
Exception in update_controller when dispatching 'truenas-update-TrueNAS': () Traceback (most recent call last): File "/config/custom_components/truenas/model.py", line 33, in update_controller model_update_items( File "/config/custom_components/truenas/model.py", line 86, in model_update_items if tmp := _register_entity(sensors, item_id, "", uid_sensor): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/truenas/model.py", line 60, in _register_entity _sensors[_item_id].async_schedule_update_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 901, in async_schedule_update_ha_state self.async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 707, in async_write_ha_state raise RuntimeError(f"Attribute hass is None for {self}") RuntimeError: Attribute hass is None for <entity None=on>

How to reproduce the issue

  1. Setup integration

Expected behavior

Successful platform setup

Screenshots

Software versions

  • Home Assistant version: HA 2023.9.0
  • TrueNAS integration version: 1.2.3
  • TrueNAS version: TBC

Diagnostics data

Traceback/Error logs

Additional context

About this issue

  • Original URL
  • State: open
  • Created 10 months ago
  • Reactions: 8
  • Comments: 22 (6 by maintainers)

Most upvoted comments

update dispatch is different from invalid device info. I’m working on new framework for my integrations which already adresses it, but I need to polish it a bit before it can be deployed to all integrations. hopefully next week.

I have exactly the same problem here. Same versions. Everything was working fine before upgrade to 2023.9. After putting by backup back to previous HA version (2023.8.4), everything worked again

no, its not related. I know what the other issue is and how to fix it. Just need moretime to polish the change and port it to this integration.

no, thats unrelated to this issue. this one is about update dispatcher

Same here, latest update 1.2.4 entities are back👍

No entities after latest HA OS update as well here

Another person here with the same problem

Same issue, same versions and remedies tried, glad to know threre’s a fix in the make.

Keep up the good work, really appreciate the integration.

(And as always, appreciate all your work. This integration has been hella useful for me!)

I wonder if this PR is at fault > https://github.com/home-assistant/core/pull/98157

On Fri, Sep 8, 2023 at 12:45 PM Jordan H @.***> wrote:

Just to clarify, is this when upgrading or just when integration operates normally?

My situation is the same as @35gh https://github.com/35gh

I’ve not rolled back though as I’m developing some other integrations.

I’ll see if I can debug in a test environment over the weekend 😃

— Reply to this email directly, view it on GitHub https://github.com/tomaae/homeassistant-truenas/issues/106#issuecomment-1711957154, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADDNYG4PM2K7ZJNU7UNZQCLXZNDT7ANCNFSM6AAAAAA4PJGBZM . You are receiving this because you commented.Message ID: @.***>

yea, its probably related to specific circumstances. we have to find them

On my side, it’s when the integration operates normally (it was working before the update). Thanks