Skip to content

Redfish collector fails with KeyError: 'StorageControllers' when Dell iDRAC exposes a valid Storage resource without that property #549

Description

@sagittariuslee

Description

hardware-observer reports:

Failure in calling the Redfish API.

redfish_call_success = 0

Redfish connectivity and authentication are functional. The failure occurs while prometheus-hardware-exporter processes the Dell iDRAC storage collection.

The Dell iDRAC exposes the following Redfish storage members:

/redfish/v1/Systems/System.Embedded.1/Storage/CPU.1
/redfish/v1/Systems/System.Embedded.1/Storage/AHCI.SL.6-1
/redfish/v1/Systems/System.Embedded.1/Storage/AHCI.Embedded.1-1
/redfish/v1/Systems/System.Embedded.1/Storage/AHCI.Embedded.2-1

Three of the resources contain a StorageControllers property, but /Storage/CPU.1 does not.

CPU.1 is nevertheless a valid Redfish Storage.v1_16_0.Storage object. It exposes 16 drives and reports healthy status:

Id: CPU.1
Name: CPU.1
Type: #Storage.v1_16_0.Storage
StorageControllers present: False
StorageControllers: None
Drives count: 16
Health: OK

The exporter currently accesses StorageControllers unconditionally:

storage_controllers_list: List[Dict] = self.redfish_obj.get(
    curr_storage_uri
).dict["StorageControllers"]

This causes:

ERROR Exception occurred while using redfish object: 'StorageControllers'

Traceback (most recent call last):
  File ".../prometheus_hardware_exporter/collector.py", line 1036, in fetch
    redfish_helper.get_storage_controller_data()
  File ".../prometheus_hardware_exporter/collectors/redfish.py", line 306, in get_storage_controller_data
    storage_controllers_list: List[Dict] = self.redfish_obj.get(curr_storage_uri).dict[
KeyError: 'StorageControllers'

Charm revision

latest/stable

Juju version

3.6.13

Cloud

No response

Expected behaviour

A valid Redfish Storage resource that does not expose a StorageControllers property should not cause the entire Redfish collector to fail.

The collector should handle the property being absent and continue processing the remaining storage resources.

Sep 02 18:37:32 dichy0318 python3[2333168]: 2026-09-02 18:37:32 INFO Response Time for GET to /redfish/v1/Systems/System.Embedded.1/Storage/: 0.03355526924133301 seconds.
Sep 02 18:37:32 dichy0318 python3[2333168]: 2026-09-02 18:37:32 INFO Attempt 1 of /redfish/v1/Systems/System.Embedded.1/Storage/CPU.1
Sep 02 18:37:32 dichy0318 python3[2333168]: 2026-09-02 18:37:32 INFO Response Time for GET to /redfish/v1/Systems/System.Embedded.1/Storage/CPU.1: 0.08768933638930321 seconds.
Sep 02 18:37:32 dichy0318 python3[2333168]: 2026-09-02 18:37:32 ERROR Exception occurred while using redfish object: 'StorageControllers'
Sep 02 18:37:32 dichy0318 python3[2333168]: Traceback (most recent call last):
Sep 02 18:37:32 dichy0318 python3[2333168]:   File "/var/lib/juju/agents/unit-hardware-observer-28/charm/venv/prometheus_hardware_exporter/collector.py", line 1036, in fetch
Sep 02 18:37:32 dichy0318 python3[2333168]:     ) = redfish_helper.get_storage_controller_data()
Sep 02 18:37:32 dichy0318 python3[2333168]:   File "/var/lib/juju/agents/unit-hardware-observer-28/charm/venv/prometheus_hardware_exporter/collectors/redfish.py", line 306, in get_storage_controller_data
Sep 02 18:37:32 dichy0318 python3[2333168]:     storage_controllers_list: List[Dict] = self.redfish_obj.get(curr_storage_uri).dict[
Sep 02 18:37:32 dichy0318 python3[2333168]: KeyError: 'StorageControllers'
Sep 02 18:37:32 dichy0318 python3[2333168]: 2026-09-02 18:37:32 INFO Attempt 1 of /redfish/v1/SessionService/Sessions/319876
Sep 02 18:37:32 dichy0318 python3[2333168]: 2026-09-02 18:37:32 INFO Response Time for DELETE to /redfish/v1/SessionService/Sessions/319876: 0.08308055624365807 seconds.

Reproduce / Test

N/A

Notes & References

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions