tomaae / homeassistant-openmediavault

OpenMediaVault integration for Home Assistant
Apache License 2.0
109 stars 15 forks source link

[Bug] Error 500 on SMART attributes #139

Closed tibouh closed 11 months ago

tibouh commented 12 months ago

Describe the issue

I recently upgraded HA container and OMV to latest version. OMV is the OS and docker is running on top. The existing OMV integration v1.4.2 was working fine until then. I was on HA 2023.10.x and OMV 6.9.5-2. The OMV integration now reports an error 500 and does not update the entities.

Software versions

Traceback/Error logs

From log file: 2023-11-03 09:32:39.448 DEBUG (SyncWorker_12) [custom_components.openmediavault.omv_api] OpenMediaVault : query: Smart, getAttributes, {'devicefile': '/dev/sdd'}, {'updatelastaccess': True} 2023-11-03 09:32:39.585 WARNING (SyncWorker_12) [custom_components.openmediavault.omv_api] OpenMediaVault : unable to fetch data (500)

From HA journal: Logger: custom_components.openmediavault.omv_api Source: custom_components/openmediavault/omv_api.py:302 Integration: OpenMediaVault (documentation, issues) First occurred: 09:27:34 (17 occurrences) Last logged: 09:43:39

thanomichalis commented 12 months ago

Same here as well

tomaae commented 12 months ago

Can you check if /dev/sdd exists?

SeanChengN commented 12 months ago

Maybe they modified SMART code. https://github.com/openmediavault/openmediavault/commit/de9fb52dd6fce74e9aa8755398ec5711dcd9c3e8 image

SeanChengN commented 12 months ago

This problem also occurs in version 6.9.6-1, all entities are invalid. home-assistant_openmediavault_2023-11-05T07-00-13.523Z.log

tomaae commented 11 months ago

I dont think so, its just some cleanup and change for USB devices. Unless you actually use USB to attach storage. Can you verify that smart works in OMV UI? such as disk temperature and smart details?

SeanChengN commented 11 months ago

@tomaae looks fine chrome_0dbSR55SZi chrome_ZYxwtPOUWP

tomaae commented 11 months ago

I had a look at RPC code in OMV, but there is no change in it. I dont have OMV on hardware so its difficult for me to figure out. @BebeMischa could you maybe check you have same issue? to comfirm if its global problem or just something related to particular setup or ciscumstances please?

tibouh commented 11 months ago

My /dev/sdd is a SD card mounted on the motherboard (HP microserver gen 8) so no SMART data on that. The SMART table goes from sdc to sde (sda to sdc being NAS drives and sde being a SSD).

tomaae commented 11 months ago

ah right, that was someone elses debug earlier that confused situation. Can you run integration in debug so I can see details?

tibouh commented 11 months ago

My /dev/sdd has "usb" on its devicefile (/dev/sde for @SeanChengN). Here is the enumerateDevices, enumerateFilesystems and getList output: log.txt We can see that the integration fails when calling getAttributes on the "usb" device (same as @SeanChengN).

tomaae commented 11 months ago

yes, I just mixed it. being usb device does not mean you cannot get smart info, so thats a no-go. only indicator I could find was missing wwn. give master a try and let me know.

conorlap commented 11 months ago

@tomaae - can confirm the latest master version has fixed it for me! 🥳 Thank you as always for the great support :)

SeanChengN commented 11 months ago

@tomaae works! Thank you!😘

thanomichalis commented 11 months ago

@tomaae i am runnig omv on a usb flash drive, so yes the master version is working for me also. Thank you

tomaae commented 11 months ago

excellent :) just make sure you have frequent backup, flash drives as boot drive are very prone to break.

thanomichalis commented 11 months ago

excellent :) just make sure you have frequent backup, flash drives as boot drive are very prone to break.

For sure. However, there is one USB Stick out there that is a SSD USB STICK. ;) Any idea on when it will be bumped this change to a new version?