{"record":{"id":"a80cc33340ad50cd","repo":"hashicorp/nomad","slug":"device-id-must-be-specified","errorCode":null,"errorMessage":"device ID must be specified","messagePattern":"device ID must be specified","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"plugins/device/device.go","lineNumber":141,"sourceCode":"type Device struct {\n\t// ID is the identifier for the device.\n\tID string\n\n\t// Healthy marks whether the device is healthy and can be used for\n\t// scheduling.\n\tHealthy bool\n\n\t// HealthDesc describes why the device may be unhealthy.\n\tHealthDesc string\n\n\t// HwLocality captures hardware locality information for the device.\n\tHwLocality *DeviceLocality\n}\n\n// Validate validates that the device is valid\nfunc (d *Device) Validate() error {\n\tif d.ID == \"\" {\n\t\treturn fmt.Errorf(\"device ID must be specified\")\n\t}\n\n\treturn nil\n}\n\n// DeviceLocality captures hardware locality information for a device.\ntype DeviceLocality struct {\n\t// PciBusID is the PCI bus ID of the device.\n\tPciBusID string\n}\n\n// ContainerReservation describes how to mount a device into a container. A\n// container is an isolated environment that shares the host's OS.\ntype ContainerReservation struct {\n\t// Envs are a set of environment variables to set for the task.\n\tEnvs map[string]string\n\n\t// Mounts are used to mount host volumes into a container that may include","sourceCodeStart":123,"sourceCodeEnd":159,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/plugins/device/device.go#L123-L159","documentation":"Device.Validate: the device ID is empty. Every device instance reported by a device plugin must carry a unique non-empty identifier used for scheduling accounting.","triggerScenarios":"Thrown at plugins/device/device.go:141 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the device plugin to assign every device instance a unique ID","Verify the plugin's device listing logic populates the ID field"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"482b49bf1aec006f089bcfc7e632d8f6ac303e5e","analyzedAt":"2026-09-04T07:54:14.808Z","contentChangedAt":"2026-09-04T07:54:14.808Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}