{"record":{"id":"964014455715a9a1","repo":"hashicorp/nomad","slug":"node-pool-q-does-not-exist","errorCode":null,"errorMessage":"node pool %q does not exist","messagePattern":"node pool %q does not exist","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/host_volume_endpoint.go","lineNumber":468,"sourceCode":"\tvar poolFromExistingNode string\n\tif vol.NodeID != \"\" {\n\t\tnode, err := snap.NodeByID(nil, vol.NodeID)\n\t\tif err != nil {\n\t\t\treturn err // should never hit, bail out\n\t\t}\n\t\tif node == nil {\n\t\t\treturn fmt.Errorf(\"node %q does not exist\", vol.NodeID)\n\t\t}\n\t\tpoolFromExistingNode = node.NodePool\n\t}\n\n\tif vol.NodePool != \"\" {\n\t\tpool, err := snap.NodePoolByName(nil, vol.NodePool)\n\t\tif err != nil {\n\t\t\treturn err // should never hit, bail out\n\t\t}\n\t\tif pool == nil {\n\t\t\treturn fmt.Errorf(\"node pool %q does not exist\", vol.NodePool)\n\t\t}\n\t\tif poolFromExistingNode != \"\" && poolFromExistingNode != pool.Name {\n\t\t\treturn fmt.Errorf(\"node ID %q is not in pool %q\", vol.NodeID, vol.NodePool)\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc (v *HostVolume) createVolume(vol *structs.HostVolume) error {\n\n\tmethod := \"ClientHostVolume.Create\"\n\tcReq := &cstructs.ClientHostVolumeCreateRequest{\n\t\tID:                        vol.ID,\n\t\tName:                      vol.Name,\n\t\tPluginID:                  vol.PluginID,\n\t\tNamespace:                 vol.Namespace,\n\t\tNodeID:                    vol.NodeID,","sourceCodeStart":450,"sourceCodeEnd":486,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/host_volume_endpoint.go#L450-L486","documentation":"validateVolumeForState also verifies that a volume's NodePool names an existing node pool; if the pool lookup returns nil, the request fails with this message. Additionally, when both NodeID and NodePool are set, the node's actual pool must match. This error covers the missing-pool case.","triggerScenarios":"Submitting a host volume via Create or Register with vol.NodePool set to a pool that does not exist in the cluster (checked via snap.NodePoolByName).","commonSituations":"Typo in pool name; node pools introduced in newer Nomad but specs written for a different cluster's pool layout; pools deleted by automation; enterprise vs OSS differences in pool availability.","solutions":["List pools with `nomad node pool list` and correct the name in the spec.","Create the missing pool first (`nomad node pool apply <name> ...`).","Omit node_pool if the volume should inherit the node's default pool.","Ensure NodePool matches the pool the referenced node actually belongs to."],"exampleFix":"// before\nnode_pool = \"gpu-pool\"  // no such pool\n// after\nnomad node pool list\nnode_pool = \"compute\"  # an existing pool","handlingStrategy":"validation","validationCode":"pools, _, _ := client.Operator().NodePoolList(nil)\nfound := false\nfor _, p := range pools.Pools {\n    if p.Name == vol.NodePool { found = true }\n}\nif !found { return fmt.Errorf(\"node pool %q does not exist\", vol.NodePool) }","typeGuard":"func poolExists(name string, pools *api.NodePoolListResponse) bool {\n    for _, p := range pools.Pools { if p.Name == name { return true } }\n    return false\n}","tryCatchPattern":"if strings.Contains(err.Error(), \"node pool\") && strings.Contains(err.Error(), \"does not exist\") {\n    // create the pool or correct the node_pool field\n}","preventionTips":["Validate pool names with `nomad node pool list`","Create required pools via IaC before volume registration","Omit node_pool to use the default pool when unsure","Keep pool naming consistent across environments"],"tags":["nomad","host-volumes","node-pool","not-found"],"backgroundTag":"referenced-resource-not-found","analyzedSha":"482b49bf1aec006f089bcfc7e632d8f6ac303e5e","analyzedAt":"2026-09-04T07:54:14.808Z","contentChangedAt":"2026-09-04T07:54:14.808Z","schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}