{"record":{"id":"84bfb30b745c8026","repo":"hashicorp/nomad","slug":"could-not-lookup-allocs-w","errorCode":null,"errorMessage":"could not lookup allocs: %w","messagePattern":"could not lookup allocs: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/state/state_store.go","lineNumber":4195,"sourceCode":"\n\treturn copyAlloc, nil\n}\n\n// cancelFollowupEvalsForReconnect cancels any follow-up evals for an allocation\n// that was awaiting reconnect and gets an update from the client that its\n// status is now known\nfunc (s *StateStore) cancelFollowupEvalsForReconnect(txn *txn, index uint64, copyAlloc, alloc *structs.Allocation) error {\n\n\tevalID, ok := copyAlloc.FollowupEvalForReconnect(alloc)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\tcopyAlloc.FollowupEvalID = \"\"\n\n\tallJobAllocs, err := s.AllocsByJob(nil, alloc.Namespace, alloc.JobID, true)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"could not lookup allocs: %w\", err)\n\t}\n\n\tfor _, jobAlloc := range allJobAllocs {\n\t\tif jobAlloc.ID != copyAlloc.ID && jobAlloc.FollowupEvalID == evalID && !jobAlloc.TerminalStatus() {\n\t\t\t// follow-up eval was created for multiple non-terminal allocs in\n\t\t\t// the job at the same time, so we leave it alone\n\t\t\treturn nil\n\t\t}\n\t}\n\n\traw, err := txn.First(\"evals\", \"id\", evalID)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"followup eval lookup failed: %v\", err)\n\t}\n\tif raw == nil {\n\t\treturn nil // eval was deleted by user\n\t}\n\teval := raw.(*structs.Evaluation)","sourceCodeStart":4177,"sourceCodeEnd":4213,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/state/state_store.go#L4177-L4213","documentation":"While cancelling follow-up evals after a node reconnect, listing the job's allocations with AllocsByJob failed; the wrapped state read error prevents determining whether the follow-up eval can be cancelled.","triggerScenarios":"Thrown at nomad/state/state_store.go:4195 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry the client status update that triggered reconnect handling","Check server logs for state store read errors"],"exampleFix":null,"handlingStrategy":"retry","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"}