hashicorp/nomad · error
unsupported attribute
Error message
unsupported attribute %q
What it means
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.
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.
Example fix
// before
constraint {
attribute = "${node.datacenter.zone}"
value = "us-east-1a"
}
// after
constraint {
attribute = "${meta.zone}"
value = "us-east-1a"
} Defensive patterns
Strategy: validation
Validate before calling
validPrefixes := []string{"${node.", "${attr.", "${meta."}
ok := slices.ContainsFunc(validPrefixes, func(p string) bool { return strings.HasPrefix(attr, p) })
if !ok { return fmt.Errorf("attribute %q is not a known node attribute", attr) } Prevention
- 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.
When it happens
Trigger: 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}".
Common situations: 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.
Related errors
- attribute is missing a closing brace
- attribute is missing an opening brace
- Constraint validation failed
- Constraint validation failed: using unsupported operand
- invalid constraint : host volumes of the same name are…
AI-assisted analysis of hashicorp/nomad@482b49bf1a (2026-09-04).
Data as JSON: /api/errors/6ba828cfe54d5daf.
Report an issue: GitHub.
Appendix: source
Thrown at nomad/structs/constraint.go:67
// Perform our exact target matching first. If the target does not hit this
// exact match, we will fall through to the prefix match check.
if slices.Contains(validConstraintExactTargets, target) {
return nil
}
// Check the target against our valid prefixes.
for _, prefix := range validConstraintPrefixTargets {
if strings.HasPrefix(target, prefix) {
return nil
}
}
// If we have reached this point, the target has not matched any valid
// options. Return an error that includes the target string, so it is
// immediately clear what constraint failed as job specifications can
// include many constraint blocks.
return fmt.Errorf("unsupported attribute %q", target)
}
View on GitHub (pinned to 482b49bf1a)