hashicorp/nomad · error

dispatch job priority must be between [%d, %d]

Error message

dispatch job priority must be between [%d, %d]

What it means

Fires in validateDispatchRequest when the dispatch request's Priority is outside the allowed band between structs.JobMinPriority and the server's configured max; dispatched jobs must carry a priority in that range.

Source

Thrown at nomad/job_endpoint.go:2195

	missing := make(map[string]struct{})
	for _, k := range job.ParameterizedJob.MetaRequired {
		if _, ok := req.Meta[k]; !ok {
			missing[k] = struct{}{}
		}
	}

	if len(missing) != 0 {
		flat := make([]string, 0, len(missing))
		for k := range missing {
			flat = append(flat, k)
		}

		return fmt.Errorf("Dispatch did not provide required meta keys: %v", flat)
	}

	// Confirm that Priority is appropriately set on the JobDispatchRequest
	if req.Priority < structs.JobMinPriority || req.Priority > config.JobMaxPriority {
		return fmt.Errorf("dispatch job priority must be between [%d, %d]", structs.JobMinPriority, config.JobMaxPriority)
	}

	return nil
}

// ScaleStatus retrieves the scaling status for a job
func (j *Job) ScaleStatus(args *structs.JobScaleStatusRequest,
	reply *structs.JobScaleStatusResponse) error {

	authErr := j.srv.Authenticate(j.ctx, args)
	if done, err := j.srv.forward("Job.ScaleStatus", args, args, reply); done {
		return err
	}
	j.srv.MeasureRPCRate("job", structs.RateMetricRead, args)
	if authErr != nil {
		return structs.ErrPermissionDenied
	}
	defer metrics.MeasureSince([]string{"nomad", "job", "scale_status"}, time.Now())

View on GitHub (pinned to 482b49bf1a)

Solutions

  1. Omit -priority on nomad job dispatch to use the job default
  2. Choose a priority within [1, configured job_max_priority]
Defensive patterns

Strategy: validation

When it happens

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