{"record":{"id":"36d2e4ce4a30e027","repo":"hashicorp/nomad","slug":"alloc-v-doesn-t-exist","errorCode":null,"errorMessage":"alloc %v doesn't exist","messagePattern":"alloc (.+?) doesn't exist","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/state/state_store.go","lineNumber":7456,"sourceCode":"\treturn s.DenormalizeAllocationDiffSlice(allocDiffs)\n}\n\n// DenormalizeAllocationDiffSlice queries the Allocation for each AllocationDiff and merges\n// the updated attributes with the existing Allocation, and attaches the Job provided.\n//\n// This should only be called on terminal alloc, particularly stopped or preempted allocs\nfunc (s *StateSnapshot) DenormalizeAllocationDiffSlice(allocDiffs []*structs.AllocationDiff) ([]*structs.Allocation, error) {\n\t// Output index for denormalized Allocations\n\tj := 0\n\n\tdenormalizedAllocs := make([]*structs.Allocation, len(allocDiffs))\n\tfor _, allocDiff := range allocDiffs {\n\t\talloc, err := s.AllocByID(nil, allocDiff.ID)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"alloc lookup failed: %v\", err)\n\t\t}\n\t\tif alloc == nil {\n\t\t\treturn nil, fmt.Errorf(\"alloc %v doesn't exist\", allocDiff.ID)\n\t\t}\n\n\t\t// Merge the updates to the Allocation.  Don't update alloc.Job for terminal allocs\n\t\t// so alloc refers to the latest Job view before destruction and to ease handler implementations\n\t\tallocCopy := alloc.Copy()\n\n\t\tif allocDiff.PreemptedByAllocation != \"\" {\n\t\t\tallocCopy.PreemptedByAllocation = allocDiff.PreemptedByAllocation\n\t\t\tallocCopy.DesiredDescription = getPreemptedAllocDesiredDescription(allocDiff.PreemptedByAllocation)\n\t\t\tallocCopy.DesiredStatus = structs.AllocDesiredStatusEvict\n\t\t} else {\n\t\t\t// If alloc is a stopped alloc\n\t\t\tallocCopy.DesiredDescription = allocDiff.DesiredDescription\n\t\t\tallocCopy.DesiredStatus = structs.AllocDesiredStatusStop\n\t\t\tallocCopy.AllocStates = allocDiff.AllocStates\n\t\t\tif allocDiff.ClientStatus != \"\" {\n\t\t\t\tallocCopy.ClientStatus = allocDiff.ClientStatus\n\t\t\t}","sourceCodeStart":7438,"sourceCodeEnd":7474,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/state/state_store.go#L7438-L7474","documentation":"DenormalizeAllocationDiffSlice could not find a concrete allocation matching an AllocationDiff (from a stopped/preempted alloc list); the referenced alloc ID no longer exists in the state store, so the diff cannot be denormalized.","triggerScenarios":"Thrown at nomad/state/state_store.go:7456 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Refresh the eval/allocs listing; the alloc may have been GC'd","Filter out stale alloc diffs referencing removed allocations","Retry once state has settled"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}