{"record":{"id":"6ba828cfe54d5daf","repo":"hashicorp/nomad","slug":"unsupported-attribute-q","errorCode":null,"errorMessage":"unsupported attribute %q","messagePattern":"unsupported attribute %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/structs/constraint.go","lineNumber":67,"sourceCode":"\n\t// Perform our exact target matching first. If the target does not hit this\n\t// exact match, we will fall through to the prefix match check.\n\tif slices.Contains(validConstraintExactTargets, target) {\n\t\treturn nil\n\t}\n\n\t// Check the target against our valid prefixes.\n\tfor _, prefix := range validConstraintPrefixTargets {\n\t\tif strings.HasPrefix(target, prefix) {\n\t\t\treturn nil\n\t\t}\n\t}\n\n\t// If we have reached this point, the target has not matched any valid\n\t// options. Return an error that includes the target string, so it is\n\t// immediately clear what constraint failed as job specifications can\n\t// include many constraint blocks.\n\treturn fmt.Errorf(\"unsupported attribute %q\", target)\n}\n","sourceCodeStart":49,"sourceCodeEnd":69,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/structs/constraint.go#L49-L69","documentation":"After checking exact valid targets and prefix-matched attribute patterns, validateConstraintAttribute rejects any remaining target with \"unsupported attribute\". This means the constraint's attribute does not correspond to any node attribute or interpolation Nomad knows about.","triggerScenarios":"Using an attribute path that matches no known node attribute prefix, e.g. \"${meta.invalid_key}\" when no allowlist matches, or a made-up attribute like \"${cluster.foo}\".","commonSituations":"Typos in node attribute names (attr, node, meta); using client-cluster attributes that don't exist; referencing attributes from other orchestrators (e.g. Kubernetes labels); Nomad version that doesn't yet support a newer attribute.","solutions":["Check the attribute name against Nomad's documented interpolation list (node.*, attr.*, meta.*).","Run `nomad node status <id> -verbose` to see the actual attributes available on your clients.","If using a client meta attribute, ensure the key is defined in the client's meta block."],"exampleFix":"// before\nconstraint {\n  attribute = \"${node.datacenter.zone}\"\n  value     = \"us-east-1a\"\n}\n// after\nconstraint {\n  attribute = \"${meta.zone}\"\n  value     = \"us-east-1a\"\n}","handlingStrategy":"validation","validationCode":"validPrefixes := []string{\"${node.\", \"${attr.\", \"${meta.\"}\nok := slices.ContainsFunc(validPrefixes, func(p string) bool { return strings.HasPrefix(attr, p) })\nif !ok { return fmt.Errorf(\"attribute %q is not a known node attribute\", attr) }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Check attribute names against Nomad's documented interpolation reference.","Inspect real client attributes with `nomad node status -verbose`.","Define client meta keys before referencing them in constraints."],"tags":["nomad","constraint","validation","attributes"],"backgroundTag":"unsupported-attribute","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"}