{"record":{"id":"6bd20b35ebb9b36c","repo":"hashicorp/nomad","slug":"only-a-single-eval-can-be-updated","errorCode":null,"errorMessage":"only a single eval can be updated","messagePattern":"only a single eval can be updated","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/eval_endpoint.go","lineNumber":297,"sourceCode":"\n// Update is used to perform an update of an Eval if it is outstanding.\nfunc (e *Eval) Update(args *structs.EvalUpdateRequest,\n\treply *structs.GenericResponse) error {\n\n\taclObj, err := e.srv.AuthenticateServerOnly(e.ctx, args)\n\te.srv.MeasureRPCRate(\"eval\", structs.RateMetricWrite, args)\n\tif err != nil || !aclObj.AllowServerOp() {\n\t\treturn structs.ErrPermissionDenied\n\t}\n\n\tif done, err := e.srv.forward(\"Eval.Update\", args, args, reply); done {\n\t\treturn err\n\t}\n\tdefer metrics.MeasureSince([]string{\"nomad\", \"eval\", \"update\"}, time.Now())\n\n\t// Ensure there is only a single update with token\n\tif len(args.Evals) != 1 {\n\t\treturn fmt.Errorf(\"only a single eval can be updated\")\n\t}\n\teval := args.Evals[0]\n\n\t// Verify the evaluation is outstanding, and that the tokens match.\n\tif err := e.srv.evalBroker.OutstandingReset(eval.ID, args.EvalToken); err != nil {\n\t\treturn err\n\t}\n\n\t// Update via Raft\n\t_, index, err := e.srv.raftApply(structs.EvalUpdateRequestType, args)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Update the index\n\treply.Index = index\n\treturn nil\n}","sourceCodeStart":279,"sourceCodeEnd":315,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/eval_endpoint.go#L279-L315","documentation":"Guard in Eval.Update: the update request carries more (or fewer) than one evaluation; the eval broker's token-based update protocol handles exactly one outstanding eval per request.","triggerScenarios":"Thrown at nomad/eval_endpoint.go:297 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Send one evaluation per Eval.Update request","Use the scheduler framework, which batches correctly"],"exampleFix":null,"handlingStrategy":"validation","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-08T15:18:49.778Z"}