hashicorp/nomad · error

No node pool with prefix %q found

Error message

No node pool with prefix %q found

What it means

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.

Source

Thrown at command/node_pool.go:113

			}
			filtered = append(filtered, pool)
		}

		return filtered
	})
}

// nodePoolByPrefix returns a node pool that matches the given prefix or a list
// of all matches if an exact match is not found.
func nodePoolByPrefix(client *api.Client, prefix string) (*api.NodePool, []*api.NodePool, error) {
	pools, _, err := client.NodePools().PrefixList(prefix, nil)
	if err != nil {
		return nil, nil, err
	}

	switch len(pools) {
	case 0:
		return nil, nil, fmt.Errorf("No node pool with prefix %q found", prefix)
	case 1:
		return pools[0], nil, nil
	default:
		for _, pool := range pools {
			if pool.Name == prefix {
				return pool, nil, nil
			}
		}
		return nil, pools, nil
	}
}

View on GitHub (pinned to 482b49bf1a)

Solutions

  1. List pools with `nomad node pool list` and use an exact name.
  2. Confirm server version supports node pools (Nomad ≥1.4) and you target the right region.
  3. Create the pool: `nomad node pool apply <name> ...`.
  4. Check for hidden/namespace-restricted pools if ACLs are in play.

Example fix

// before (shell)
nomad node pool status prodiction   # typo
// after
nomad node pool list
nomad node pool status production
Defensive patterns

Strategy: validation

Validate before calling

// shell: verify pool exists first
nomad node pool list | awk 'NR>1{print $1}' | grep -qx "$POOL" \
  || { echo "node pool $POOL not found"; exit 1; }

Try / catch

// bash: branch on message
if ! out=$(nomad node pool status "$POOL" 2>&1); then
  case "$out" in *"No node pool with prefix"*) nomad node pool list ;; esac
fi

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


AI-assisted analysis of hashicorp/nomad@482b49bf1a (2026-09-04). Data as JSON: /api/errors/dd53bc44400cf735. Report an issue: GitHub.