{"record":{"id":"4ac750a79031fd4e","repo":"hashicorp/nomad","slug":"unable-to-look-up-summary-for-job-v","errorCode":null,"errorMessage":"unable to look up summary for job: %v","messagePattern":"unable to look up summary for job: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/job_endpoint.go","lineNumber":1456,"sourceCode":"\t\t\t\treply.Jobs = make([]*structs.JobListStub, 0)\n\t\t\t} else if err != nil {\n\t\t\t\treturn err\n\t\t\t} else {\n\t\t\t\tif prefix := args.QueryOptions.Prefix; prefix != \"\" {\n\t\t\t\t\titer, err = state.JobsByIDPrefix(ws, namespace, prefix, sort)\n\t\t\t\t} else if namespace != structs.AllNamespacesSentinel {\n\t\t\t\t\titer, err = state.JobsByNamespace(ws, namespace, sort)\n\t\t\t\t} else {\n\t\t\t\t\titer, err = state.Jobs(ws, sort)\n\t\t\t\t}\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\n\t\t\t\tstubFn := func(job *structs.Job) (*structs.JobListStub, error) {\n\t\t\t\t\tsummary, err := state.JobSummaryByID(ws, job.Namespace, job.ID)\n\t\t\t\t\tif err != nil || summary == nil {\n\t\t\t\t\t\treturn nil, fmt.Errorf(\"unable to look up summary for job: %v\", job.ID)\n\t\t\t\t\t}\n\t\t\t\t\treturn job.Stub(summary, args.Fields), nil\n\t\t\t\t}\n\n\t\t\t\tpager, err := paginator.NewPaginator(iter, args.QueryOptions,\n\t\t\t\t\tpaginator.NamespaceSelectorFunc[*structs.Job](allowableNamespaces),\n\t\t\t\t\tpaginator.NamespaceIDTokenizer[*structs.Job](args.NextToken),\n\t\t\t\t\tstubFn)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn structs.NewErrRPCCodedf(\n\t\t\t\t\t\thttp.StatusBadRequest, \"%s: %v\", structs.ErrResultPaginatorCreation, err)\n\t\t\t\t}\n\n\t\t\t\tjobs, nextToken, err := pager.Page()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn structs.NewErrRPCCodedf(\n\t\t\t\t\t\thttp.StatusBadRequest, \"failed to read result page: %v\", err)\n\t\t\t\t}","sourceCodeStart":1438,"sourceCodeEnd":1474,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/job_endpoint.go#L1438-L1474","documentation":"While paginating a job list, the stub builder looked up the job's summary via state.JobSummaryByID and got either an error or a nil summary. Since every registered job must have a summary row, this signals a state-store inconsistency (missing summary for an existing job), and the list request fails for that job.","triggerScenarios":"GET /v1/jobs (Job.List) with the standard stubFn closure at nomad/job_endpoint.go:1456 when JobSummaryByID(ws, ns, id) errors or returns nil for a job in the iterator, e.g. a summary row missing from the raft state.","commonSituations":"Corrupted or partially restored state-store snapshots/backups; jobs created by direct state manipulation or tooling bypassing the normal register path; raft log replay issues after a crash.","solutions":["Re-register the affected job (nomad job run/revert) to recreate its summary row.","Check wrapped store errors for raft/consul snapshot corruption and restore from a good backup if needed.","Verify job ID/namespace in the request are correct; a lookup bug can masquerade as a missing summary.","If it persists after re-registration, collect a bundle and report to Nomad — a nil summary is an internal invariant violation."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"job, _, err := client.Jobs().Info(jobID, nil)\nif err != nil || job == nil { return fmt.Errorf(\"job %s does not exist; skip listing\", jobID) }","typeGuard":null,"tryCatchPattern":"jobs, _, err := client.Jobs().List(nil)\nif err != nil && strings.Contains(err.Error(), \"unable to look up summary\") {\n    // retry once; if it persists, re-register the affected job\n    jobs, _, err = client.Jobs().List(retryOpts)\n}","preventionTips":["Never modify the Nomad state store with tools bypassing the API.","Restore snapshots only from verified backups.","Re-register jobs after any state restore to rebuild summary rows."],"tags":["nomad","state-store","job-list"],"backgroundTag":"state-store-inconsistency","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"}