hashicorp/nomad · error
missing node pool name
Error message
missing node pool name
What it means
parseNodePoolLimit validates the `node_pool` block of a quota spec, where each entry's key is the node pool name. An entry with zero keys yields "missing node pool name", prefixed `resources, node pool[N]->`. Node pool quotas require a named entry per pool being limited.
Source
Thrown at command/quota_apply.go:417
var m map[string]any
if err := hcl.DecodeObject(&m, o.Val); err != nil {
return err
}
if err := mapstructure.WeakDecode(m, &device); err != nil {
return err
}
*result = append(*result, &device)
}
return nil
}
func parseNodePoolLimit(result *[]*api.NodePoolLimit, list *ast.ObjectList) error {
for idx, o := range list.Items {
if l := len(o.Keys); l == 0 {
return multierror.Prefix(fmt.Errorf("missing node pool name"), fmt.Sprintf("resources, node pool[%d]->", idx))
} else if l > 1 {
return multierror.Prefix(fmt.Errorf("only one name may be specified"), fmt.Sprintf("resources, node pool[%d]->", idx))
}
name := o.Keys[0].Token.Value().(string)
// Check for invalid keys
valid := []string{
"cores",
"cpu",
"memory",
"memory_max",
"device",
"storage",
}
if err := helper.CheckHCLKeys(o.Val, valid); err != nil {
return err
}View on GitHub (pinned to 482b49bf1a)
Solutions
- Add the pool name as the block key: `node_pool "prod" { memory_mb = 8192 }`.
- Use the `node pool[N]` index in the error to locate the entry.
- Ensure you run a Nomad client version that supports node pool quotas (>=1.4).
- Cross-check the stanza against official quota examples.
Example fix
// before
node_pool {
memory_mb = 8192
}
// after
node_pool "prod" {
memory_mb = 8192
} Defensive patterns
Strategy: validation
Validate before calling
for idx, item := range nodePoolList.Items {
if len(item.Keys) == 0 {
return fmt.Errorf("resources, node pool[%d]-> missing node pool name", idx)
}
} Type guard
func nodePoolHasName(item *hclast.ObjectItem) bool {
return item != nil && len(item.Keys) == 1
} Prevention
- Use named blocks: node_pool "pool-name" { ... }
- Lint HCL quota specs in CI
- Keep pool names matching `nomad node pool list` output
- Require Nomad >=1.4 client for node pool quota syntax
When it happens
Trigger: A quota file contains an anonymous `node_pool { ... }` block (no name key) inside resources, e.g. from copy-pasting job node_pool syntax or hand-editing that removed the quoted pool name.
Common situations: Template files with a placeholder pool name deleted; HCL generation code emitting unlabeled blocks; migrating between Nomad versions where syntax examples differ (node pool quotas were added in Nomad 1.4+).
Related errors
- error parsing: root should be an object
- limit should be an object
- only one 'region_limit' block allowed per limit
- resource: should be an object
- invalid variables limit: %v
AI-assisted analysis of hashicorp/nomad@482b49bf1a (2026-09-04).
Data as JSON: /api/errors/43d40dd967bd0442.
Report an issue: GitHub.