KeyError: 'dev' in disk.availability on R50 (empty Array Device Slot entries)

Environment

  • TrueNAS 25.10.4
  • Hardware: TrueNAS R50 (SMC SC826-P 100b)
  • Fresh install, no pools created yet

Description

The Storage page, Disks list, and Create Pool dialog all fail with this traceback:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/middlewared/api/base/server/ws_handler/rpc.py", line 387, in process_method_call
    result = await method.call(app, id_, params)
  ...
  File "/usr/lib/python3/dist-packages/middlewared/plugins/disk_/availability.py", line 55, in details_impl
    enc_info[info['dev']] = (int(slot), enc['id'])
KeyError: 'dev'

The crash comes from this block in disk_/availability.py:

enc_info = dict()
for enc in await self.middleware.call('enclosure2.query'):
    for slot, info in filter(lambda x: x[1], enc['elements']['Array Device Slot'].items()):
        enc_info[info['dev']] = (int(slot), enc['id'])

enclosure2.query returns empty front slots that lack a "dev" key entirely:

"1": {
  "descriptor": "Slot00",
  "status": "Not installed",
  "value": null,
  "value_raw": 83886080
}

The rear NVMe slots (49-51) contain "dev": null. Both cases break the dict lookup.

The same enclosure ID appears twice in the query result (different bsg devices). That may be related but is secondary to the missing key.

Steps to reproduce

  1. Install 25.10.4 on an R50.
  2. Log into the UI.
  3. Open Storage or try to create a pool.

Expected
Disk details load. Empty slots are ignored or handled without a KeyError.

Actual
Middleware raises KeyError: ‘dev’ and the UI shows the traceback.

Workaround that works
Change the loop to:

if (dev := info.get('dev')) is not None:
    enc_info[dev] = (int(slot), enc['id'])

After that change and a middlewared restart the Disks page loads normally.

Full enclosure2.query output available on request.

Can you list a detailed hardware listing of how your R50 is set up?

You may have to wait for posts by TrueNAS Employees as most of us are not familiar with their hardware products nor set up. They are usually running TrueNAS Enterprise versions.

how can i share that?

Post as detailed as a listing of the hardware you can make.

I tried searching for documents but the user manuals are not listed in English, if I am seeing it correctly.

Do you have a current support contract? If you do use that to get support for this OS and hardware.

full story here is i bought this board from ebay, and its not really a R50, however in bios and in truenas, both think its an R50.

[
  {
    "name": "SMC SC826-P 100b",
    "model": "R50",
    "controller": true,
    "dmi": "TRUENAS-R50",
    "status": [
      "OK"
    ],
    "id": "50030480xxxxxxxx",
    "vendor": "SMC",
    "product": "SC826-P",
    "revision": "100b",
    "bsg": "/dev/bsg/13:0:24:0",
    "sg": "/dev/sg51",
    "pci": "13:0:24:0",
    "rackmount": true,
    "top_loaded": true,
    "top_slots": 48,
    "front_loaded": false,
    "front_slots": 0,
    "rear_slots": 3,
    "internal_slots": 0,
    "elements": {
      "Array Device Slot": {
        "1": {
          "descriptor": "Slot00",
          "status": "Not installed",
          "value": null,
          "value_raw": 83886080
        },
        "2": {
          "descriptor": "Slot01",
          "status": "Not installed",
          "value": null,
          "value_raw": 83886080
        },
        "3": {
          "descriptor": "Slot02",
          "status": "Not installed",
          "value": null,
          "value_raw": 83886080
        },
        "4": {
          "descriptor": "Slot03",
          "status": "Not installed",
          "value": null,
          "value_raw": 83886080
        },
        "5": {
          "descriptor": "Slot04",
          "status": "Not installed",
          "value": null,
          "value_raw": 83886080
        },
        "6": {
          "descriptor": "Slot05",
          "status": "Not installed",
          "value": null,
          "value_raw": 83886080
        },
        "7": {
          "descriptor": "Slot06",
          "status": "Not installed",
          "value": null,
          "value_raw": 83886080
        },
        "8": {
          "descriptor": "Slot07",
          "status": "Not installed",
          "value": null,
          "value_raw": 83886080
        },
        "9": {
          "descriptor": "Slot08",
          "status": "Not installed",
          "value": null,
          "value_raw": 83886080
        },
        "10": {
          "descriptor": "Slot09",
          "status": "Not installed",
          "value": null,
          "value_raw": 83886080
        },
        "11": {
          "descriptor": "Slot10",
          "status": "Not installed",
          "value": null,
          "value_raw": 83886080
        },
        "12": {
          "descriptor": "Slot11",
          "status": "Not installed",
          "value": null,
          "value_raw": 83886080
        }
      },
      "SAS Connector": {
        "14": {
          "descriptor": "ConnectorA",
          "status": "OK",
          "value": "Mini SAS HD 4i receptacle (SFF-8643) [max 4 phys]",
          "value_raw": 17956864
        },
        "15": {
          "descriptor": "ConnectorB",
          "status": "OK",
          "value": "Mini SAS HD 4i receptacle (SFF-8643) [max 4 phys]",
          "value_raw": 17956864
        },
        "16": {
          "descriptor": "ConnectorC",
          "status": "OK",
          "value": "Mini SAS HD 4i receptacle (SFF-8643) [max 4 phys]",
          "value_raw": 17956864
        },
        "17": {
          "descriptor": "ConnectorD",
          "status": "OK",
          "value": "Mini SAS HD 4i receptacle (SFF-8643) [max 4 phys]",
          "value_raw": 17956864
        },
        "18": {
          "descriptor": "Drive Connector 00",
          "status": "OK",
          "value": "SAS Drive backplane receptacle (SFF-8482) [max 2 phys]",
          "value_raw": 18874368
        },
        "19": {
          "descriptor": "Drive Connector 01",
          "status": "OK",
          "value": "SAS Drive backplane receptacle (SFF-8482) [max 2 phys]",
          "value_raw": 18874368
        },
        "20": {
          "descriptor": "Drive Connector 02",
          "status": "OK",
          "value": "SAS Drive backplane receptacle (SFF-8482) [max 2 phys]",
          "value_raw": 18874368
        },
        "21": {
          "descriptor": "Drive Connector 03",
          "status": "OK",
          "value": "SAS Drive backplane receptacle (SFF-8482) [max 2 phys]",
          "value_raw": 18874368
        },
        "22": {
          "descriptor": "Drive Connector 04",
          "status": "OK",
          "value": "SAS Drive backplane receptacle (SFF-8482) [max 2 phys]",
          "value_raw": 18874368
        },
        "23": {
          "descriptor": "Drive Connector 05",
          "status": "OK",
          "value": "SAS Drive backplane receptacle (SFF-8482) [max 2 phys]",
          "value_raw": 18874368
        },
        "24": {
          "descriptor": "Drive Connector 06",
          "status": "OK",
          "value": "SAS Drive backplane receptacle (SFF-8482) [max 2 phys]",
          "value_raw": 18874368
        },
        "25": {
          "descriptor": "Drive Connector 07",
          "status": "OK",
          "value": "SAS Drive backplane receptacle (SFF-8482) [max 2 phys]",
          "value_raw": 18874368
        },
        "26": {
          "descriptor": "Drive Connector 08",
          "status": "OK",
          "value": "SAS Drive backplane receptacle (SFF-8482) [max 2 phys]",
          "value_raw": 18874368
        },
        "27": {
          "descriptor": "Drive Connector 09",
          "status": "OK",
          "value": "SAS Drive backplane receptacle (SFF-8482) [max 2 phys]",
          "value_raw": 18874368
        },
        "28": {
          "descriptor": "Drive Connector 10",
          "status": "OK",
          "value": "SAS Drive backplane receptacle (SFF-8482) [max 2 phys]",
          "value_raw": 18874368
        },
        "29": {
          "descriptor": "Drive Connector 11",
          "status": "OK",
          "value": "SAS Drive backplane receptacle (SFF-8482) [max 2 phys]",
          "value_raw": 18874368
        }
      },
      "SAS Expander": {
        "33": {
          "descriptor": "FW 66.16.11.00/MFG 16.11",
          "status": "OK",
          "value": null,
          "value_raw": 16777216
        }
      },
      "Temperature Sensors": {
        "35": {
          "descriptor": "ChipDie",
          "status": "OK",
          "value": "64C",
          "value_raw": 16798720
        },
        "36": {
          "descriptor": "BackPlaneLM75",
          "status": "OK",
          "value": "35C",
          "value_raw": 16791296
        }
      },
      "Voltage Sensor": {
        "38": {
          "descriptor": "12VEXP",
          "status": "OK",
          "value": "12.11V",
          "value_raw": 16778427
        },
        "39": {
          "descriptor": "5VEXP",
          "status": "OK",
          "value": "5.07V",
          "value_raw": 16777723
        }
      }
    },
    "label": "SMC SC826-P 100b"
  },
  {
    "name": "SMC SC826-P 100b",
    "model": "R50",
    "controller": true,
    "dmi": "TRUENAS-R50",
    "status": [
      "OK"
    ],
    "id": "50030480xxxxxxxx",
    "vendor": "SMC",
    "product": "SC826-P",
    "revision": "100b",
    "bsg": "/dev/bsg/0:0:0:0",
    "sg": "/dev/sg2",
    "pci": "0:0:0:0",
    "rackmount": true,
    "top_loaded": true,
    "top_slots": 48,
    "front_loaded": false,
    "front_slots": 0,
    "rear_slots": 3,
    "internal_slots": 0,
    "elements": {
      "Array Device Slot": {
        "1": {
          "descriptor": "Slot00",
          "status": "Not installed",
          "value": null,
          "value_raw": 83886080
        },
        "2": {
          "descriptor": "Slot01",
          "status": "Not installed",
          "value": null,
          "value_raw": 83886080
        },
        "3": {
          "descriptor": "Slot02",
          "status": "Not installed",
          "value": null,
          "value_raw": 83886080
        },
        "4": {
          "descriptor": "Slot03",
          "status": "Not installed",
          "value": null,
          "value_raw": 83886080
        },
        "5": {
          "descriptor": "Slot04",
          "status": "Not installed",
          "value": null,
          "value_raw": 83886080
        },
        "6": {
          "descriptor": "Slot05",
          "status": "Not installed",
          "value": null,
          "value_raw": 83886080
        },
        "7": {
          "descriptor": "Slot06",
          "status": "Not installed",
          "value": null,
          "value_raw": 83886080
        },
        "8": {
          "descriptor": "Slot07",
          "status": "Not installed",
          "value": null,
          "value_raw": 83886080
        },
        "9": {
          "descriptor": "Slot08",
          "status": "Not installed",
          "value": null,
          "value_raw": 83886080
        },
        "10": {
          "descriptor": "Slot09",
          "status": "Not installed",
          "value": null,
          "value_raw": 83886080
        },
        "11": {
          "descriptor": "Slot10",
          "status": "Not installed",
          "value": null,
          "value_raw": 83886080
        },
        "12": {
          "descriptor": "Slot11",
          "status": "Not installed",
          "value": null,
          "value_raw": 83886080
        },
        "49": {
          "descriptor": "Disk #1",
          "status": "Not installed",
          "value": null,
          "value_raw": 83886080,
          "dev": null,
          "supports_identify_light": false,
          "drive_bay_light_status": null,
          "is_front": false,
          "is_rear": true,
          "is_top": false,
          "is_internal": false,
          "original": {
            "enclosure_id": "r50_nvme_enclosure",
            "enclosure_sg": null,
            "enclosure_bsg": null,
            "descriptor": "slot1",
            "slot": 1
          }
        },
        "50": {
          "descriptor": "Disk #2",
          "status": "Not installed",
          "value": null,
          "value_raw": 83886080,
          "dev": null,
          "supports_identify_light": false,
          "drive_bay_light_status": null,
          "is_front": false,
          "is_rear": true,
          "is_top": false,
          "is_internal": false,
          "original": {
            "enclosure_id": "r50_nvme_enclosure",
            "enclosure_sg": null,
            "enclosure_bsg": null,
            "descriptor": "slot2",
            "slot": 2
          }
        },
        "51": {
          "descriptor": "Disk #3",
          "status": "Not installed",
          "value": null,
          "value_raw": 83886080,
          "dev": null,
          "supports_identify_light": false,
          "drive_bay_light_status": null,
          "is_front": false,
          "is_rear": true,
          "is_top": false,
          "is_internal": false,
          "original": {
            "enclosure_id": "r50_nvme_enclosure",
            "enclosure_sg": null,
            "enclosure_bsg": null,
            "descriptor": "slot3",
            "slot": 3
          }
        }
      },
      "SAS Connector": {
        "14": {
          "descriptor": "ConnectorA",
          "status": "OK",
          "value": "Mini SAS HD 4i receptacle (SFF-8643) [max 4 phys]",
          "value_raw": 17956864
        },
        "15": {
          "descriptor": "ConnectorB",
          "status": "OK",
          "value": "Mini SAS HD 4i receptacle (SFF-8643) [max 4 phys]",
          "value_raw": 17956864
        },
        "16": {
          "descriptor": "ConnectorC",
          "status": "OK",
          "value": "Mini SAS HD 4i receptacle (SFF-8643) [max 4 phys]",
          "value_raw": 17956864
        },
        "17": {
          "descriptor": "ConnectorD",
          "status": "OK",
          "value": "Mini SAS HD 4i receptacle (SFF-8643) [max 4 phys]",
          "value_raw": 17956864
        },
        "18": {
          "descriptor": "Drive Connector 00",
          "status": "OK",
          "value": "SAS Drive backplane receptacle (SFF-8482) [max 2 phys]",
          "value_raw": 18874368
        },
        "19": {
          "descriptor": "Drive Connector 01",
          "status": "OK",
          "value": "SAS Drive backplane receptacle (SFF-8482) [max 2 phys]",
          "value_raw": 18874368
        },
        "20": {
          "descriptor": "Drive Connector 02",
          "status": "OK",
          "value": "SAS Drive backplane receptacle (SFF-8482) [max 2 phys]",
          "value_raw": 18874368
        },
        "21": {
          "descriptor": "Drive Connector 03",
          "status": "OK",
          "value": "SAS Drive backplane receptacle (SFF-8482) [max 2 phys]",
          "value_raw": 18874368
        },
        "22": {
          "descriptor": "Drive Connector 04",
          "status": "OK",
          "value": "SAS Drive backplane receptacle (SFF-8482) [max 2 phys]",
          "value_raw": 18874368
        },
        "23": {
          "descriptor": "Drive Connector 05",
          "status": "OK",
          "value": "SAS Drive backplane receptacle (SFF-8482) [max 2 phys]",
          "value_raw": 18874368
        },
        "24": {
          "descriptor": "Drive Connector 06",
          "status": "OK",
          "value": "SAS Drive backplane receptacle (SFF-8482) [max 2 phys]",
          "value_raw": 18874368
        },
        "25": {
          "descriptor": "Drive Connector 07",
          "status": "OK",
          "value": "SAS Drive backplane receptacle (SFF-8482) [max 2 phys]",
          "value_raw": 18874368
        },
        "26": {
          "descriptor": "Drive Connector 08",
          "status": "OK",
          "value": "SAS Drive backplane receptacle (SFF-8482) [max 2 phys]",
          "value_raw": 18874368
        },
        "27": {
          "descriptor": "Drive Connector 09",
          "status": "OK",
          "value": "SAS Drive backplane receptacle (SFF-8482) [max 2 phys]",
          "value_raw": 18874368
        },
        "28": {
          "descriptor": "Drive Connector 10",
          "status": "OK",
          "value": "SAS Drive backplane receptacle (SFF-8482) [max 2 phys]",
          "value_raw": 18874368
        },
        "29": {
          "descriptor": "Drive Connector 11",
          "status": "OK",
          "value": "SAS Drive backplane receptacle (SFF-8482) [max 2 phys]",
          "value_raw": 18874368
        }
      },
      "SAS Expander": {
        "33": {
          "descriptor": "FW 66.16.11.00/MFG 16.11",
          "status": "OK",
          "value": null,
          "value_raw": 16777216
        }
      },
      "Temperature Sensors": {
        "35": {
          "descriptor": "ChipDie",
          "status": "OK",
          "value": "64C",
          "value_raw": 16798720
        },
        "36": {
          "descriptor": "BackPlaneLM75",
          "status": "OK",
          "value": "35C",
          "value_raw": 16791296
        }
      },
      "Voltage Sensor": {
        "38": {
          "descriptor": "12VEXP",
          "status": "OK",
          "value": "12.11V",
          "value_raw": 16778427
        },
        "39": {
          "descriptor": "5VEXP",
          "status": "OK",
          "value": "5.07V",
          "value_raw": 16777723
        }
      }
    },
    "label": "SMC SC826-P 100b"
  }
]

TrueNAS OS has customizations for the TrueNAS hardware that give additional info for the physical layouts. I am guessing that is broken because you don’t have a full system

right, thats likely whats going on here, need to figure out how to update the smbios/fru

i ended up erasing the smbios via a bios update in the BMC, it gave an option to perserve the SMBIOS, after that the system no longer thinks its a R50, and it also fixes the disks page.