{"record":{"id":"794a2b66436fd197","repo":"hashicorp/nomad","slug":"no-node-meets-constraints-d-nodes-had-existing-v","errorCode":null,"errorMessage":"no node meets constraints: %d nodes had existing volume, %d nodes filtered by node pool governance, %d nodes were infeasible","messagePattern":"no node meets constraints: (.+?) nodes had existing volume, (.+?) nodes filtered by node pool governance, (.+?) nodes were infeasible","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/host_volume_endpoint.go","lineNumber":624,"sourceCode":"\t\tif !poolFilterFn(candidate.NodePool) {\n\t\t\tfilteredByGovernance++\n\t\t\tcontinue\n\t\t}\n\n\t\tif checker != nil {\n\t\t\tif ok := checker.Feasible(candidate); !ok {\n\t\t\t\tfilteredByFeasibility++\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\n\t\tvol.NodeID = candidate.ID\n\t\tvol.NodePool = candidate.NodePool\n\t\treturn candidate, nil\n\n\t}\n\n\treturn nil, fmt.Errorf(\n\t\t\"no node meets constraints: %d nodes had existing volume, %d nodes filtered by node pool governance, %d nodes were infeasible\",\n\t\tfilteredByExisting, filteredByGovernance, filteredByFeasibility)\n}\n\n// placementContext implements the scheduler.ConstraintContext interface, a\n// minimal subset of the scheduler.Context interface that we need to create a\n// feasibility checker for constraints\ntype placementContext struct {\n\tregexpCache  map[string]*regexp.Regexp\n\tversionCache map[string]feasible.VerConstraints\n\tsemverCache  map[string]feasible.VerConstraints\n}\n\nfunc (ctx *placementContext) Metrics() *structs.AllocMetric          { return &structs.AllocMetric{} }\nfunc (ctx *placementContext) RegexpCache() map[string]*regexp.Regexp { return ctx.regexpCache }\n\nfunc (ctx *placementContext) VersionConstraintCache() map[string]feasible.VerConstraints {\n\treturn ctx.versionCache","sourceCodeStart":606,"sourceCodeEnd":642,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/host_volume_endpoint.go#L606-L642","documentation":"If no NodeID is given, placeHostVolume iterates candidate nodes (optionally limited to a node pool) and filters them by three criteria: a node already hosting a volume with the same name, node-pool governance disallowing it, or constraint infeasibility. When every candidate is filtered out, it returns this diagnostic summary with per-reason counts instead of placing the volume.","triggerScenarios":"Creating a host volume without NodeID where the cluster (or chosen NodePool) has no node that simultaneously: lacks an existing volume of the same name, passes pool governance, and satisfies the plugin/constraint checks — e.g. a one-node pool where the node already has a volume with that name.","commonSituations":"Single-node dev clusters creating a second volume with the same name; all nodes missing the plugin; all pool nodes blocked by namespace governance; overly restrictive constraints (datacenter, meta, driver).","solutions":["Read the counts in the message: if 'existing volume' > 0, rename the volume or reuse/delete the existing one.","If 'governance' > 0, align the namespace's node pool allowlist with the target pool.","If 'infeasible' > 0, ensure the host-volume plugin is installed on candidates or loosen constraints.","Add more nodes to the pool or target a different NodePool."],"exampleFix":"// before (2nd volume with same name on 1-node pool)\ncreate HostVolume{Name: \"cache\", NodePool: \"dev\"}\n// after\ncreate HostVolume{Name: \"cache-2\", NodePool: \"dev\"}","handlingStrategy":"retry","validationCode":"nodes, _, _ := client.Nodes().List(nil)\npool := vol.NodePool\neligible := 0\nfor _, n := range nodes {\n    if pool == \"\" || n.NodePool == pool { eligible++ }\n}\nif eligible == 0 { return fmt.Errorf(\"no eligible nodes in pool %q; fix pool/constraints first\", pool) }","typeGuard":null,"tryCatchPattern":"err := createVolume(vol)\nif err != nil && strings.Contains(err.Error(), \"no node meets constraints\") {\n    // parse counts and decide: rename volume, fix constraints, or add nodes, then retry\n    if strings.Contains(err.Error(), \"had existing volume\") { vol.Name = vol.Name + \"-2\" }\n    err = createVolume(vol)\n}","preventionTips":["Avoid reusing volume names within a small node pool.","Keep constraints minimal; prefer pool selection over attribute constraints.","Ensure the host-volume plugin is deployed fleet-wide on target pools."],"tags":["nomad","host-volumes","placement","constraints","scheduling"],"backgroundTag":"no-node-meets-constraints","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"}