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

SuperMicro storage controller KeyError #115

Closed
honghan-wong opened this issue Nov 21, 2023 · 2 comments
Closed

SuperMicro storage controller KeyError #115

honghan-wong opened this issue Nov 21, 2023 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@honghan-wong
Copy link
Contributor

We got an KeyError when deployed on Supermicro (H12DST-B) server

Traceback (most recent call last):
  File "/usr/lib/python3.8/wsgiref/handlers.py", line 137, in run
    self.result = application(self.environ, self.start_response)
  File "/var/lib/juju/agents/unit-hardware-observer-host-5/charm/venv/prometheus_client/exposition.py", line 128, in prometheus_app
    status, headers, output = _bake_output(registry, accept_header, accept_encoding_header, params, disable_compression)
  File "/var/lib/juju/agents/unit-hardware-observer-host-5/charm/venv/prometheus_client/exposition.py", line 104, in _bake_output
    output = encoder(registry)
  File "/var/lib/juju/agents/unit-hardware-observer-host-5/charm/venv/prometheus_client/openmetrics/exposition.py", line 21, in generate_latest
    for metric in registry.collect():
  File "/var/lib/juju/agents/unit-hardware-observer-host-5/charm/venv/prometheus_client/registry.py", line 97, in collect
    yield from collector.collect()
  File "/var/lib/juju/agents/unit-hardware-observer-host-5/charm/venv/prometheus_hardware_exporter/core.py", line 114, in collect
    payloads = self.fetch()
  File "/var/lib/juju/agents/unit-hardware-observer-host-5/charm/venv/prometheus_hardware_exporter/collector.py", line 972, in fetch
    ) = redfish_helper.get_storage_controller_data()
  File "/var/lib/juju/agents/unit-hardware-observer-host-5/charm/venv/prometheus_hardware_exporter/collectors/redfish.py", line 275, in get_storage_controller_data
    "controller_id": data["MemberId"],
KeyError: 'MemberId'

The output is as below from redfish API

curl -k -u 'user:pass' https://redfish.api/redfish/v1/Systems/1/Storage/NVMeSSD | jq
{
  "@odata.type": "#Storage.v1_7_1.Storage",
  "@odata.id": "/redfish/v1/Systems/1/Storage/NVMeSSD",
  "Id": "NVMeSSD",
  "Name": "NVMe Storage System",
  "StorageControllers": [
    {
      "@odata.id": "/redfish/v1/Systems/1/Storage/NVMeSSD#/StorageControllers/0",
      "MemberId": "0",
      "@odata.type": "#Storage.v1_7_1.StorageController",
      "FirmwareVersion": "00",
      "Status": {
        "State": "Enabled",
        "Health": "OK"
      },
      "Identifiers": [
        {
          "DurableName": ""
        }
      ],
      "SupportedControllerProtocols": [
        "PCIe"
      ],
      "SupportedDeviceProtocols": [
        "NVMe"
      ],
      "Oem": {}
    }
  ],
  "Drives": [
    {
      "@odata.id": "/redfish/v1/Chassis/NVMeSSD.0.Group.0.StorageBackplane/Drives/Disk.Bay.0"
    },
    {
      "@odata.id": "/redfish/v1/Chassis/NVMeSSD.0.Group.0.StorageBackplane/Drives/Disk.Bay.1"
    }
  ],
  "Volumes": {
    "@odata.id": "/redfish/v1/Systems/1/Storage/NVMeSSD/Volumes"
  },
  "Links": {
    "Enclosures": [
      {
        "@odata.id": "/redfish/v1/Chassis/NVMeSSD.0.Group.0.StorageBackplane"
      }
    ]
  },
  "Oem": {},
  "Description": "NVMe SSD",
  "Status": {
    "State": "Enabled",
    "Health": "OK"
  }
}
@Pjack Pjack added the bug Something isn't working label Nov 30, 2023
@Pjack Pjack added this to the 23.10.2 milestone Nov 30, 2023
@jneo8
Copy link
Contributor

jneo8 commented Dec 4, 2023

The general error should be catch by exporter now.

canonical/prometheus-hardware-exporter#52

Still need to provide fix for redfish.

@honghan-wong
Copy link
Contributor Author

the error has been by fixed canonical/prometheus-hardware-exporter#71

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants