hashicorp/nomad · error

job can't be submitted with 'Dispatched' set

Error message

job can't be submitted with 'Dispatched' set

What it means

Fires in validateJobUpdate when registering a brand-new job (old == nil) whose Dispatched field is true: the Dispatched flag is server-set and only meaningful on jobs created via dispatch of a parameterized job.

Source

Thrown at nomad/job_endpoint.go:1950

		if err != nil {
			return fmt.Errorf("Failed to parse cron expression: %v", err)
		}
	}

	reply.FailedTGAllocs = updatedEval.FailedTGAllocs
	reply.JobModifyIndex = index
	reply.Annotations = annotations
	reply.CreatedEvals = planner.CreateEvals
	reply.Index = index
	return nil
}

// validateJobUpdate ensures updates to a job are valid.
func validateJobUpdate(old, new *structs.Job) error {
	// Validate Dispatch not set on new Jobs
	if old == nil {
		if new.Dispatched {
			return fmt.Errorf("job can't be submitted with 'Dispatched' set")
		}
		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

View on GitHub (pinned to 482b49bf1a)

Solutions

  1. Remove the Dispatched field from the job spec
  2. Use nomad job dispatch on a parameterized job to obtain dispatched child jobs
Defensive patterns

Strategy: validation

When it happens

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