You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Logger: custom_components.unraid.api.disk_state
Zdroj: custom_components/unraid/api/disk_state.py:175
integrace: UNRAID (dokumentace, problémy)
První výskyt: 13:18:01 (22 výskyty)
Naposledy logováno: 13:36:46
Error checking disk state for /dev/nvme0n1p1: cannot access local variable 'result' where it is not associated with a value
Traceback (most recent call last):
File "/config/custom_components/unraid/api/disk_state.py", line 175, in get_disk_state
getattr(result, 'exit_status', 'not_run'),
^^^^^^
UnboundLocalError: cannot access local variable 'result' where it is not associated with a value
I run debug a reload integration and this is log for that device:
2025-01-06 13:49:12.499 DEBUG (MainThread) [custom_components.unraid.api.disk_state] Found device path for temp: /dev/nvme0n1p1
2025-01-06 13:49:12.500 DEBUG (MainThread) [custom_components.unraid.api.disk_state] NVMe device /dev/nvme0n1p1: always active
2025-01-06 13:49:12.500 ERROR (MainThread) [custom_components.unraid.api.disk_state] Error checking disk state for /dev/nvme0n1p1: cannot access local variable 'result' where it is not associated with a value
Traceback (most recent call last):
File "/config/custom_components/unraid/api/disk_state.py", line 175, in get_disk_state
getattr(result, 'exit_status', 'not_run'),
^^^^^^
UnboundLocalError: cannot access local variable 'result' where it is not associated with a value
As I look into disk_state.py, problem is, in code from line 169 is used "result"
# Log final decision with full context
_LOGGER.debug(
"Final state for %s (%s): %s (SMART result: %s, hdparm result: %s)",
device_path,
device_type,
state.value,
getattr(result, 'exit_status', 'not_run'),
getattr(result, 'stdout', 'not_run').strip() if hasattr(result, 'stdout') else 'not_run'
)
But that "result" is filled only in IF part for sata drives (from line 98 to line 159), but for NVMe drives it go to ELSE part where is not filled "result" which is used in both cases in already mentioned debug part from line 169.
This issue is probably not functional, probably it have impact only to logging 😊 so this is low priority.
Expected behavior
Screenshots
Debug Log
Unraid (please complete the following information):
Version 6.2.14
Home Assistant (please complete the following information):
Version 2025.1.0
Home Assistant installation type (please complete the following information):
Docker / Container
Virtual Machine
Raspberry Pi
Baremetal
Additional context
The text was updated successfully, but these errors were encountered:
Describe the bug
In HA logs I found this error:
I run debug a reload integration and this is log for that device:
As I look into disk_state.py, problem is, in code from line 169 is used "result"
But that "result" is filled only in IF part for sata drives (from line 98 to line 159), but for NVMe drives it go to ELSE part where is not filled "result" which is used in both cases in already mentioned debug part from line 169.
This issue is probably not functional, probably it have impact only to logging 😊 so this is low priority.
Expected behavior
Screenshots
Debug Log
Unraid (please complete the following information):
Home Assistant (please complete the following information):
Home Assistant installation type (please complete the following information):
Additional context
The text was updated successfully, but these errors were encountered: