{"record":{"id":"43d40dd967bd0442","repo":"hashicorp/nomad","slug":"missing-node-pool-name-43d40d","errorCode":null,"errorMessage":"missing node pool name","messagePattern":"missing node pool name","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"command/quota_apply.go","lineNumber":417,"sourceCode":"\n\t\tvar m map[string]any\n\t\tif err := hcl.DecodeObject(&m, o.Val); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tif err := mapstructure.WeakDecode(m, &device); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t*result = append(*result, &device)\n\t}\n\treturn nil\n}\n\nfunc parseNodePoolLimit(result *[]*api.NodePoolLimit, list *ast.ObjectList) error {\n\tfor idx, o := range list.Items {\n\t\tif l := len(o.Keys); l == 0 {\n\t\t\treturn multierror.Prefix(fmt.Errorf(\"missing node pool name\"), fmt.Sprintf(\"resources, node pool[%d]->\", idx))\n\t\t} else if l > 1 {\n\t\t\treturn multierror.Prefix(fmt.Errorf(\"only one name may be specified\"), fmt.Sprintf(\"resources, node pool[%d]->\", idx))\n\t\t}\n\n\t\tname := o.Keys[0].Token.Value().(string)\n\n\t\t// Check for invalid keys\n\t\tvalid := []string{\n\t\t\t\"cores\",\n\t\t\t\"cpu\",\n\t\t\t\"memory\",\n\t\t\t\"memory_max\",\n\t\t\t\"device\",\n\t\t\t\"storage\",\n\t\t}\n\t\tif err := helper.CheckHCLKeys(o.Val, valid); err != nil {\n\t\t\treturn err\n\t\t}","sourceCodeStart":399,"sourceCodeEnd":435,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/command/quota_apply.go#L399-L435","documentation":"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.","triggerScenarios":"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.","commonSituations":"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+).","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."],"exampleFix":"// before\nnode_pool {\n  memory_mb = 8192\n}\n// after\nnode_pool \"prod\" {\n  memory_mb = 8192\n}","handlingStrategy":"validation","validationCode":"for idx, item := range nodePoolList.Items {\n    if len(item.Keys) == 0 {\n        return fmt.Errorf(\"resources, node pool[%d]-> missing node pool name\", idx)\n    }\n}","typeGuard":"func nodePoolHasName(item *hclast.ObjectItem) bool {\n    return item != nil && len(item.Keys) == 1\n}","tryCatchPattern":null,"preventionTips":["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"],"tags":["nomad","hcl","quota","node-pool"],"backgroundTag":"missing-block-name","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"}