{"record":{"id":"780fe8931a061db0","repo":"hashicorp/nomad","slug":"only-a-single-eval-can-be-created","errorCode":null,"errorMessage":"only a single eval can be created","messagePattern":"only a single eval can be created","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/eval_endpoint.go","lineNumber":334,"sourceCode":"\n// Create is used to make a new evaluation\nfunc (e *Eval) Create(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.Create\", args, args, reply); done {\n\t\treturn err\n\t}\n\tdefer metrics.MeasureSince([]string{\"nomad\", \"eval\", \"create\"}, 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 created\")\n\t}\n\teval := args.Evals[0]\n\n\t// Verify the parent evaluation is outstanding, and that the tokens match.\n\tif err := e.srv.evalBroker.OutstandingReset(eval.PreviousEval, args.EvalToken); err != nil {\n\t\treturn err\n\t}\n\n\t// Look for the eval\n\tsnap, err := e.srv.fsm.State().Snapshot()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tws := memdb.NewWatchSet()\n\tout, err := snap.EvalByID(ws, eval.ID)\n\tif err != nil {\n\t\treturn err","sourceCodeStart":316,"sourceCodeEnd":352,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/eval_endpoint.go#L316-L352","documentation":"Guard in Eval.Create: the request contains a number of evaluations other than one; creating evals via this RPC is single-eval by contract with the eval token bookkeeping.","triggerScenarios":"Thrown at nomad/eval_endpoint.go:334 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Submit exactly one evaluation per Eval.Create request"],"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-08T10:18:20.063Z"}