{"record":{"id":"a4150a9849951638","repo":"hashicorp/nomad","slug":"failed-to-lookup-related-evals-v","errorCode":null,"errorMessage":"failed to lookup related evals: %v","messagePattern":"failed to lookup related evals: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/eval_endpoint.go","lineNumber":90,"sourceCode":"\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\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Setup the output.\n\t\t\treply.Eval = eval\n\t\t\tif eval != nil {\n\t\t\t\treply.Index = eval.ModifyIndex\n\t\t\t} else {\n\t\t\t\t// Use the last index that affected the evals table\n\t\t\t\tindex, err := state.Index(\"evals\")\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}","sourceCodeStart":72,"sourceCodeEnd":108,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/eval_endpoint.go#L72-L108","documentation":"Fires inside Eval.Get when IncludeRelated is set and the state store query for evaluations related to the requested eval fails — a state store read error while gathering the eval's related evaluations.","triggerScenarios":"Thrown at nomad/eval_endpoint.go:90 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect server logs for state store errors","Retry the query; transient read failures usually resolve","Drop IncludeRelated if only the eval itself is needed"],"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"}