hashicorp/nomad · error

only a single eval can be updated

Error message

only a single eval can be updated

What it means

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.

Source

Thrown at nomad/eval_endpoint.go:297

// Update is used to perform an update of an Eval if it is outstanding.
func (e *Eval) Update(args *structs.EvalUpdateRequest,
	reply *structs.GenericResponse) error {

	aclObj, err := e.srv.AuthenticateServerOnly(e.ctx, args)
	e.srv.MeasureRPCRate("eval", structs.RateMetricWrite, args)
	if err != nil || !aclObj.AllowServerOp() {
		return structs.ErrPermissionDenied
	}

	if done, err := e.srv.forward("Eval.Update", args, args, reply); done {
		return err
	}
	defer metrics.MeasureSince([]string{"nomad", "eval", "update"}, time.Now())

	// Ensure there is only a single update with token
	if len(args.Evals) != 1 {
		return fmt.Errorf("only a single eval can be updated")
	}
	eval := args.Evals[0]

	// Verify the evaluation is outstanding, and that the tokens match.
	if err := e.srv.evalBroker.OutstandingReset(eval.ID, args.EvalToken); err != nil {
		return err
	}

	// Update via Raft
	_, index, err := e.srv.raftApply(structs.EvalUpdateRequestType, args)
	if err != nil {
		return err
	}

	// Update the index
	reply.Index = index
	return nil
}

View on GitHub (pinned to 482b49bf1a)

Solutions

  1. Send one evaluation per Eval.Update request
  2. Use the scheduler framework, which batches correctly
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at nomad/eval_endpoint.go:297 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of hashicorp/nomad@482b49bf1a (2026-09-04). Data as JSON: /api/errors/6bd20b35ebb9b36c. Report an issue: GitHub.