{"record":{"id":"dd53bc44400cf735","repo":"hashicorp/nomad","slug":"no-node-pool-with-prefix-q-found","errorCode":null,"errorMessage":"No node pool with prefix %q found","messagePattern":"No node pool with prefix %q found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"command/node_pool.go","lineNumber":113,"sourceCode":"\t\t\t}\n\t\t\tfiltered = append(filtered, pool)\n\t\t}\n\n\t\treturn filtered\n\t})\n}\n\n// nodePoolByPrefix returns a node pool that matches the given prefix or a list\n// of all matches if an exact match is not found.\nfunc nodePoolByPrefix(client *api.Client, prefix string) (*api.NodePool, []*api.NodePool, error) {\n\tpools, _, err := client.NodePools().PrefixList(prefix, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tswitch len(pools) {\n\tcase 0:\n\t\treturn nil, nil, fmt.Errorf(\"No node pool with prefix %q found\", prefix)\n\tcase 1:\n\t\treturn pools[0], nil, nil\n\tdefault:\n\t\tfor _, pool := range pools {\n\t\t\tif pool.Name == prefix {\n\t\t\t\treturn pool, nil, nil\n\t\t\t}\n\t\t}\n\t\treturn nil, pools, nil\n\t}\n}\n","sourceCodeStart":95,"sourceCodeEnd":125,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/command/node_pool.go#L95-L125","documentation":"nodePoolByPrefix resolves a node pool name/prefix via the node pools API. When the returned pool list is empty, it throws \"No node pool with prefix %q found\". Like getNamespace, this is input resolution: the supplied prefix matched zero node pools in the cluster.","triggerScenarios":"Running a command whose Run handler resolves a node pool argument (e.g. `nomad node pool status <prefix>` in versions ≥1.4/1.5 where node pools exist) with a prefix matching no pools.","commonSituations":"Typo in the pool name; using a pool that exists in another cluster/region; targeting a pre-1.4 server where node pools don't exist or defaults differ; pool deleted recently.","solutions":["List pools with `nomad node pool list` and use an exact name.","Confirm server version supports node pools (Nomad ≥1.4) and you target the right region.","Create the pool: `nomad node pool apply <name> ...`.","Check for hidden/namespace-restricted pools if ACLs are in play."],"exampleFix":"// before (shell)\nnomad node pool status prodiction   # typo\n// after\nnomad node pool list\nnomad node pool status production","handlingStrategy":"validation","validationCode":"// shell: verify pool exists first\nnomad node pool list | awk 'NR>1{print $1}' | grep -qx \"$POOL\" \\\n  || { echo \"node pool $POOL not found\"; exit 1; }","typeGuard":null,"tryCatchPattern":"// bash: branch on message\nif ! out=$(nomad node pool status \"$POOL\" 2>&1); then\n  case \"$out\" in *\"No node pool with prefix\"*) nomad node pool list ;; esac\nfi","preventionTips":["Create node pools in IaC before workloads reference them.","Confirm Nomad server version ≥1.4 when using node pool commands.","Centralize pool names as variables rather than typing them per command."],"tags":["cli","nomad","node-pool","not-found"],"backgroundTag":"resource-not-found","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"}