{"record":{"id":"7dcd4dea9364c8de","repo":"hashicorp/nomad","slug":"failed-to-get-job-s-allocations-v","errorCode":null,"errorMessage":"failed to get job's allocations: %v","messagePattern":"failed to get job's allocations: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"scheduler/feasible/propertyset.go","lineNumber":149,"sourceCode":"\t// Populate the proposed when setting the constraint. We do this because\n\t// when detecting if we can inplace update an allocation we stage an\n\t// eviction and then select. This means the plan has an eviction before a\n\t// single select has finished.\n\tp.PopulateProposed()\n}\n\nfunc (p *propertySet) SetTargetValues(values []string) {\n\tp.targetValues = set.From(values)\n}\n\n// populateExisting is a helper shared when setting the constraint to populate\n// the existing values.\nfunc (p *propertySet) populateExisting() {\n\t// Retrieve all previously placed allocations\n\tws := memdb.NewWatchSet()\n\tallocs, err := p.ctx.State().AllocsByJob(ws, p.namespace, p.jobID, false)\n\tif err != nil {\n\t\tp.errorBuilding = fmt.Errorf(\"failed to get job's allocations: %v\", err)\n\t\tp.logger.Error(\"failed to get job's allocations\", \"job\", p.jobID, \"namespace\", p.namespace, \"error\", err)\n\t\treturn\n\t}\n\n\t// Filter to the correct set of allocs\n\tallocs = p.filterAllocs(allocs, true)\n\n\t// Get all the nodes that have been used by the allocs\n\tnodes, err := p.buildNodeMap(allocs)\n\tif err != nil {\n\t\tp.errorBuilding = err\n\t\tp.logger.Error(\"failed to build node map\", \"error\", err)\n\t\treturn\n\t}\n\n\t// Build existing properties map\n\tp.populateProperties(allocs, nodes, p.existingValues)\n}","sourceCodeStart":131,"sourceCodeEnd":167,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/scheduler/feasible/propertyset.go#L131-L167","documentation":"propertySet.populateExisting() fetches all previously placed allocations for the job from the Nomad state store via StateStore.AllocsByJob. If that state store lookup returns an error, the scheduler wraps it in this message and marks errorBuilding, aborting feasibility evaluation for the property set. It signals an internal state-store failure, not a scheduling constraint problem.","triggerScenarios":"StateStore.AllocsByJob returns an error while building the property set during placement evaluation — e.g. memdb/state store corruption, an aborted or closed state store snapshot, or an index iteration failure. Called via setTargetAttributeWithCount during stack feasibility checks.","commonSituations":"Server state store pressure/corruption, Raft restore in progress, state store snapshot closed mid-eval, or resource exhaustion on the Nomad server (OOM, file descriptor limits).","solutions":["Inspect the wrapped inner error (%v) in the server logs to identify the underlying state store failure","Restart the Nomad server leader election (or the agent) to rebuild the state store in memory","Check server health: memory, disk, and raft state; run 'nomad operator raft list-peers' and verify cluster stability","If corruption is suspected, restore from a raft snapshot or resync from other servers"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// Verify cluster/state health before submitting work\nstatus := exec.Command(\"nomad\", \"status\").Run()\nif status != nil { log.Fatal(\"nomad cluster unreachable or unhealthy\") }","typeGuard":null,"tryCatchPattern":"// Transient state store failures: rely on Nomad's eval retry\n// Operators: monitor evals\nnomad eval list | grep -i failed\nnomad server members\n# If persistent, restart leader or restore raft snapshot","preventionTips":["Monitor Nomad server memory/disk and raft health","Keep servers patched to the latest Nomad release","Alert on failed evals via nomad eval list / metrics","Take regular raft snapshots for recovery"],"tags":["nomad","scheduler","state-store"],"backgroundTag":"state-store-lookup-failed","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"}