{"record":{"id":"b4c3de271ce2da28","repo":"hashicorp/nomad","slug":"no-attribute-value-set","errorCode":null,"errorMessage":"no attribute value set","messagePattern":"no attribute value set","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"plugins/shared/structs/attribute.go","lineNumber":274,"sourceCode":"\t}\n\n\t// Assert only one of the attributes is set\n\tset := 0\n\tif a.Float != nil {\n\t\tset++\n\t}\n\tif a.Int != nil {\n\t\tset++\n\t}\n\tif a.String != nil {\n\t\tset++\n\t}\n\tif a.Bool != nil {\n\t\tset++\n\t}\n\n\tif set == 0 {\n\t\treturn fmt.Errorf(\"no attribute value set\")\n\t} else if set > 1 {\n\t\treturn fmt.Errorf(\"only one attribute value may be set\")\n\t}\n\n\treturn nil\n}\n\n// Comparable returns whether the two attributes are comparable\nfunc (a *Attribute) Comparable(b *Attribute) bool {\n\tif a == nil || b == nil {\n\t\treturn false\n\t}\n\n\t// First use the units to decide if comparison is possible\n\taUnit := a.getTypedUnit()\n\tbUnit := b.getTypedUnit()\n\tif aUnit != nil && bUnit != nil {\n\t\treturn aUnit.Comparable(bUnit)","sourceCodeStart":256,"sourceCodeEnd":292,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/plugins/shared/structs/attribute.go#L256-L292","documentation":"Attribute.Validate: none of the Float/Int/String/Bool value fields is set. An attribute must carry exactly one value to be usable in constraints and node metadata.","triggerScenarios":"Thrown at plugins/shared/structs/attribute.go:274 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set exactly one value field (float, int, string, or bool) on the attribute","Verify the producer of the attribute populates its value"],"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"}