{"record":{"id":"47056fabcd388ef0","repo":"hashicorp/nomad","slug":"failed-to-lookup-eval-v","errorCode":null,"errorMessage":"failed to lookup eval: %v","messagePattern":"failed to lookup eval: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/eval_endpoint.go","lineNumber":77,"sourceCode":"\tallowNsOp := acl.NamespaceValidator(acl.NamespaceCapabilityReadJob)\n\taclObj, err := e.srv.ResolveACL(args)\n\tif err != nil {\n\t\treturn err\n\t} else if !allowNsOp(aclObj, args.RequestNamespace()) {\n\t\treturn structs.ErrPermissionDenied\n\t}\n\n\t// Setup the blocking query\n\topts := blockingOptions{\n\t\tqueryOpts: &args.QueryOptions,\n\t\tqueryMeta: &reply.QueryMeta,\n\t\trun: func(ws memdb.WatchSet, state *state.StateStore) error {\n\t\t\tvar related []*structs.EvaluationStub\n\n\t\t\t// Look for the eval\n\t\t\teval, err := state.EvalByID(ws, args.EvalID)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"failed to lookup eval: %v\", err)\n\t\t\t}\n\n\t\t\tif eval != nil {\n\t\t\t\t// Re-check namespace in case it differs from request.\n\t\t\t\tif !allowNsOp(aclObj, eval.Namespace) {\n\t\t\t\t\treturn structs.ErrPermissionDenied\n\t\t\t\t}\n\n\t\t\t\t// Lookup related evals if requested.\n\t\t\t\tif args.IncludeRelated {\n\t\t\t\t\trelated, err = state.EvalsRelatedToID(ws, eval.ID)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn fmt.Errorf(\"failed to lookup related evals: %v\", err)\n\t\t\t\t\t}\n\n\t\t\t\t\t// Use a copy to avoid modifying the original eval.\n\t\t\t\t\teval = eval.Copy()\n\t\t\t\t\teval.RelatedEvals = related","sourceCodeStart":59,"sourceCodeEnd":95,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/eval_endpoint.go#L59-L95","documentation":"Fires inside the blocking Eval.Get RPC when the state store lookup of the evaluation by ID returns an error (Raft/state store failure); it is not a not-found case — not-found yields a nil eval and an empty reply.","triggerScenarios":"Thrown at nomad/eval_endpoint.go:77 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check server logs for Raft or memdb errors","Verify cluster health and quorum","Retry the eval read once the state store is healthy"],"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"}