hashicorp/nomad · error

cannot update parameterized job to being non-parameterized

Error message

cannot update parameterized job to being non-parameterized

What it means

Fires in validateJobUpdate when a job that was parameterized is updated to a spec without a parameterized block; Nomad forbids crossing the parameterized/non-parameterized boundary on update.

Source

Thrown at nomad/job_endpoint.go:1970

		return nil
	}

	// Type transitions are disallowed
	if old.Type != new.Type {
		return fmt.Errorf("cannot update job from type %q to %q", old.Type, new.Type)
	}

	// Transitioning to/from periodic is disallowed
	if old.IsPeriodic() && !new.IsPeriodic() {
		return fmt.Errorf("cannot update periodic job to being non-periodic")
	}
	if new.IsPeriodic() && !old.IsPeriodic() {
		return fmt.Errorf("cannot update non-periodic job to being periodic")
	}

	// Transitioning to/from parameterized is disallowed
	if old.IsParameterized() && !new.IsParameterized() {
		return fmt.Errorf("cannot update parameterized job to being non-parameterized")
	}
	if new.IsParameterized() && !old.IsParameterized() {
		return fmt.Errorf("cannot update non-parameterized job to being parameterized")
	}

	if old.Dispatched != new.Dispatched {
		return fmt.Errorf("field 'Dispatched' is read-only")
	}

	return nil
}

// Dispatch a parameterized job.
func (j *Job) Dispatch(args *structs.JobDispatchRequest, reply *structs.JobDispatchResponse) error {
	authErr := j.srv.Authenticate(j.ctx, args)
	if done, err := j.srv.forward("Job.Dispatch", args, args, reply); done {
		return err
	}

View on GitHub (pinned to 482b49bf1a)

Solutions

  1. Keep the parameterized block on the updated job
  2. Deregister and register a fresh non-parameterized job if the change is intended
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at nomad/job_endpoint.go:1970 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/da1a8ff786b3cbe6. Report an issue: GitHub.