{"record":{"id":"11904d655e1655cb","repo":"hashicorp/nomad","slug":"eval-insert-failed-v","errorCode":null,"errorMessage":"eval insert failed: %v","messagePattern":"eval insert failed: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/state/state_store.go","lineNumber":2071,"sourceCode":"\t\texisting, err := txn.First(\"evals\", \"id\", eval.ID)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"eval lookup failed: %v\", err)\n\t\t}\n\t\tif existing == nil {\n\t\t\tcontinue\n\t\t}\n\n\t\tif existing.(*structs.Evaluation).Status != structs.EvalStatusPending {\n\t\t\tcontinue\n\t\t}\n\n\t\teval := existing.(*structs.Evaluation).Copy()\n\t\teval.Status = structs.EvalStatusComplete\n\t\teval.StatusDescription = fmt.Sprintf(\"job %s deleted\", job.ID)\n\n\t\t// Insert the eval\n\t\tif err := txn.Insert(\"evals\", eval); err != nil {\n\t\t\treturn fmt.Errorf(\"eval insert failed: %v\", err)\n\t\t}\n\t\tif err := txn.Insert(\"index\", &IndexEntry{\"evals\", index}); err != nil {\n\t\t\treturn fmt.Errorf(\"index update failed: %v\", err)\n\t\t}\n\t}\n\n\t// Delete allocs associated with the job\n\tif err := s.deleteAllocsForJobTxn(txn, index, namespace, job.ID); err != nil {\n\t\treturn err\n\t}\n\n\t// Cleanup plugins registered by this job, before we delete the summary\n\terr = s.deleteJobFromPlugins(index, txn, job)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"deleting job from plugin: %v\", err)\n\t}\n\n\t// Delete the job summary","sourceCodeStart":2053,"sourceCodeEnd":2089,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/state/state_store.go#L2053-L2089","documentation":"While marking a pending eval complete during job deletion, inserting the updated eval into memdb failed; the wrapped insert error aborts the delete transaction.","triggerScenarios":"Thrown at nomad/state/state_store.go:2071 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry the delete operation","Check server logs for state store write errors","Verify Raft/state health if inserts keep failing"],"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"}