{"record":{"id":"e9872a6d1f01277a","repo":"hashicorp/nomad","slug":"setting-job-status-for-q-failed-v","errorCode":null,"errorMessage":"setting job status for %q failed: %v","messagePattern":"setting job status for %q failed: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/state/state_store.go","lineNumber":1862,"sourceCode":"\t\t// when changing an internal field such as Stable. A spec change should\n\t\t// always come with a version bump\n\t\tif !keepVersion {\n\t\t\tjob.JobModifyIndex = index\n\t\t\tif job.Version <= existingJob.Version {\n\t\t\t\tif sub == nil {\n\t\t\t\t\t// in the reversion case we must set the submission to be\n\t\t\t\t\t// that of the job version we are reverting to\n\t\t\t\t\tsub, _ = s.jobSubmission(nil, job.Namespace, job.ID, job.Version, txn)\n\t\t\t\t}\n\t\t\t\tjob.Version = existingJob.Version + 1\n\t\t\t}\n\t\t}\n\n\t\t// Compute the job status\n\t\tvar err error\n\t\tjob.Status, err = s.getJobStatus(txn, job, false)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"setting job status for %q failed: %v\", job.ID, err)\n\t\t}\n\t} else {\n\t\tjob.CreateIndex = index\n\t\tjob.ModifyIndex = index\n\t\tjob.JobModifyIndex = index\n\n\t\tif err := s.setJobStatus(index, txn, job, false, \"\"); err != nil {\n\t\t\treturn fmt.Errorf(\"setting job status for %q failed: %v\", job.ID, err)\n\t\t}\n\n\t\t// Have to get the job again since it could have been updated\n\t\tupdated, err := txn.First(\"jobs\", \"id\", job.Namespace, job.ID)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"job lookup failed: %v\", err)\n\t\t}\n\t\tif updated != nil {\n\t\t\tjob = updated.(*structs.Job)\n\t\t}","sourceCodeStart":1844,"sourceCodeEnd":1880,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/state/state_store.go#L1844-L1880","documentation":"While upserting the job, computing its status via getJobStatus returned an error; the wrapped failure happens during state-derived status calculation (e.g. reading evals/allocs) and aborts the registration.","triggerScenarios":"Thrown at nomad/state/state_store.go:1862 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry the job registration","Inspect server logs for the underlying state store read error","Verify cluster/state health if it persists"],"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"}