{"record":{"id":"2f1ec05da1165278","repo":"hashicorp/nomad","slug":"device-attribute-q-invalid-v","errorCode":null,"errorMessage":"device attribute %q invalid: %v","messagePattern":"device attribute %q invalid: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"plugins/device/device.go","lineNumber":114,"sourceCode":"\t}\n\tif d.Name == \"\" {\n\t\t_ = multierror.Append(&mErr, fmt.Errorf(\"device name must be specified\"))\n\t}\n\n\tfor i, dev := range d.Devices {\n\t\tif dev == nil {\n\t\t\t_ = multierror.Append(&mErr, fmt.Errorf(\"device %d is nil\", i))\n\t\t\tcontinue\n\t\t}\n\n\t\tif err := dev.Validate(); err != nil {\n\t\t\t_ = multierror.Append(&mErr, multierror.Prefix(err, fmt.Sprintf(\"device %d: \", i)))\n\t\t}\n\t}\n\n\tfor k, v := range d.Attributes {\n\t\tif err := v.Validate(); err != nil {\n\t\t\t_ = multierror.Append(&mErr, fmt.Errorf(\"device attribute %q invalid: %v\", k, err))\n\t\t}\n\t}\n\n\treturn mErr.ErrorOrNil()\n\n}\n\n// Device is an instance of a particular device.\ntype 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","sourceCodeStart":96,"sourceCodeEnd":132,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/plugins/device/device.go#L96-L132","documentation":"DeviceGroup.Validate: one of the attribute values in the attributes map failed its own Attribute.Validate check (bad unit, wrong value cardinality, etc.), keyed by the attribute name.","triggerScenarios":"Thrown at plugins/device/device.go:114 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the named attribute per its nested validation error","Ensure each attribute has exactly one value and a recognized unit"],"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"}