{"record":{"id":"01f219240b558dc9","repo":"hashicorp/nomad","slug":"error-getting-job-summary-v","errorCode":null,"errorMessage":"error getting job summary: %v","messagePattern":"error getting job summary: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/state/state_store.go","lineNumber":1591,"sourceCode":"\t\t\treturn fmt.Errorf(\"csi_plugins delete error: %v\", err)\n\t\t}\n\t} else {\n\t\tplug.ModifyIndex = index\n\t\terr := txn.Insert(TableCSIPlugins, plug)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"csi_plugins update error %s: %v\", plug.ID, err)\n\t\t}\n\t}\n\treturn nil\n}\n\n// deleteJobFromPlugins removes the allocations of this job from any plugins the job is\n// running, possibly deleting the plugin if it's no longer in use. It's called in DeleteJobTxn\nfunc (s *StateStore) deleteJobFromPlugins(index uint64, txn Txn, job *structs.Job) error {\n\tws := memdb.NewWatchSet()\n\tsummary, err := s.JobSummaryByID(ws, job.Namespace, job.ID)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error getting job summary: %v\", err)\n\t}\n\n\tallocs, err := s.AllocsByJob(ws, job.Namespace, job.ID, false)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error getting allocations: %v\", err)\n\t}\n\n\ttype pair struct {\n\t\tpluginID string\n\t\talloc    *structs.Allocation\n\t}\n\n\tplugAllocs := []*pair{}\n\tfound := map[string]struct{}{}\n\n\t// Find plugins for allocs that belong to this job\n\tfor _, a := range allocs {\n\t\ttg := a.Job.LookupTaskGroup(a.TaskGroup)","sourceCodeStart":1573,"sourceCodeEnd":1609,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/state/state_store.go#L1573-L1609","documentation":"Wraps a failure reading the job summary during deleteJobFromPlugins, invoked from DeleteJobTxn to strip the job's allocations from CSI plugins. JobSummaryByID errored, so the job delete cannot proceed and the transaction aborts.","triggerScenarios":"nomad job stop / job deregistration for a job with CSI allocations; the internal ws lookup of the job's summary row fails (job summary row missing or memdb error).","commonSituations":"Seen when deleting jobs that had been partially mutated (e.g. summary rows affected by earlier failed ops or known Nomad job-summary bugs), or during state-store inconsistency.","solutions":["Retry the job deletion.","Check nomad job status and nomad alloc status for the job to see whether state is partially applied; stop remaining allocs first.","Inspect the wrapped %v error for the underlying memdb cause.","Upgrade Nomad — job-summary consistency bugs have been fixed in patch releases; as a last resort restore Raft state from backup."],"exampleFix":"// before: force-purge fails with this error\n$ nomad job stop -purge csi-job\n// after: stop and wait for allocs to become terminal, then purge\n$ nomad job stop csi-job\n$ nomad job status csi-job   # wait: all allocs terminal\n$ nomad job stop -purge csi-job","handlingStrategy":"try-catch","validationCode":"// before purging a job with CSI volumes, confirm state is coherent\njob, _, err := client.Jobs().Info(jobID, nil)\nif err != nil { return err }\nallocs, _, err := client.Jobs().Allocations(jobID, false, nil)\nif err != nil { return err }\nfor _, a := range allocs {\n    if a.ClientStatus != \"complete\" && a.ClientStatus != \"failed\" {\n        return fmt.Errorf(\"alloc %s not terminal; stop job first\", a.ID)\n    }\n}","typeGuard":null,"tryCatchPattern":"_, _, err := client.Jobs().Deregister(jobID, true, nil)\nif err != nil && strings.Contains(err.Error(), \"error getting job summary\") {\n    // job state partially applied; retry after allocs settle, then force purge\n    time.Sleep(10 * time.Second)\n    _, _, err = client.Jobs().Deregister(jobID, true, nil)\n}\nreturn err","preventionTips":["Always stop CSI plugin jobs and deregister volumes before purging jobs.","Wait for allocations to reach terminal state before -purge.","Avoid hard-killing Nomad servers mid-job-delete; use graceful shutdown.","Keep Nomad patched — job-summary consistency bugs exist in old releases."],"tags":["nomad","csi","state-store","job-summary"],"backgroundTag":"job-state-read-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"}