{"record":{"id":"55b72cbf9743e77d","repo":"hashicorp/nomad","slug":"job-summary-lookup-failed-v-55b72c","errorCode":null,"errorMessage":"job summary lookup failed: %v","messagePattern":"job summary lookup failed: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/state/state_store.go","lineNumber":3495,"sourceCode":"\t// Lookup the evaluation\n\texisting, err := txn.First(\"evals\", \"id\", eval.ID)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"eval lookup failed: %v\", err)\n\t}\n\n\t// Update the indexes\n\tif existing != nil {\n\t\teval.CreateIndex = existing.(*structs.Evaluation).CreateIndex\n\t\teval.ModifyIndex = index\n\t} else {\n\t\teval.CreateIndex = index\n\t\teval.ModifyIndex = index\n\t}\n\n\t// Update the job summary\n\tsummaryRaw, err := txn.First(\"job_summary\", \"id\", eval.Namespace, eval.JobID)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"job summary lookup failed: %v\", err)\n\t}\n\tif summaryRaw != nil {\n\t\tjs := summaryRaw.(*structs.JobSummary).Copy()\n\t\thasSummaryChanged := false\n\t\tfor tg, num := range eval.QueuedAllocations {\n\t\t\tif summary, ok := js.Summary[tg]; ok {\n\t\t\t\tif summary.Queued != num {\n\t\t\t\t\tsummary.Queued = num\n\t\t\t\t\tjs.Summary[tg] = summary\n\t\t\t\t\thasSummaryChanged = true\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\ts.logger.Error(\"unable to update queued for job and task group\", \"job_id\", eval.JobID, \"task_group\", tg, \"namespace\", eval.Namespace)\n\t\t\t}\n\t\t}\n\n\t\t// Insert the job summary\n\t\tif hasSummaryChanged {","sourceCodeStart":3477,"sourceCodeEnd":3513,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/state/state_store.go#L3477-L3513","documentation":"Returned by StateStore.nestedUpsertEval when txn.First on the 'job_summary' table fails while fetching the summary for the eval's (Namespace, JobID). The eval upsert needs the job summary to track queued allocations per task group; if this lookup errors the whole transaction is aborted.","triggerScenarios":"Calling UpsertEvals when the job_summary read for eval.Namespace/eval.JobID errors in memdb — internal read failure rather than an absent summary (absent is handled by skipping the update).","commonSituations":"Evals for jobs whose summaries were concurrently removed; memdb read failure from schema mismatch after upgrade; namespaces/job IDs manipulated by custom tooling.","solutions":["Check the wrapped inner memdb error in the message","Confirm the eval's namespace/job ID correspond to a registered job","Restart servers to rebuild in-memory state if corruption is suspected","Keep nomad versions consistent across the server cluster"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Confirm the job (and its summary) exists before upserting evals\nsum, err := state.JobSummaryByID(ws, eval.Namespace, eval.JobID)\nif err != nil { return err }\n// nil summary is tolerated by nestedUpsertEval; error means memdb failure","typeGuard":"if js, ok := raw.(*structs.JobSummary); ok { /* use js */ }","tryCatchPattern":"if err := state.UpsertEvals(idx, evals); err != nil {\n\tif strings.Contains(err.Error(), \"job summary lookup failed\") {\n\t\t// inspect inner memdb cause; retry once, else restart\n\t}\n\treturn err\n}","preventionTips":["Create jobs (and summaries) before producing evals for them","Match namespaces exactly when creating evals","Monitor for version-skew induced schema mismatches"],"tags":["nomad","state-store","evals","job-summary"],"backgroundTag":"memdb-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"}