{"record":{"id":"1572a7cdec07bc6c","repo":"hashicorp/nomad","slug":"dispatch-job-priority-must-be-between-d-d","errorCode":null,"errorMessage":"dispatch job priority must be between [%d, %d]","messagePattern":"dispatch job priority must be between \\[(.+?), (.+?)\\]","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/job_endpoint.go","lineNumber":2195,"sourceCode":"\tmissing := make(map[string]struct{})\n\tfor _, k := range job.ParameterizedJob.MetaRequired {\n\t\tif _, ok := req.Meta[k]; !ok {\n\t\t\tmissing[k] = struct{}{}\n\t\t}\n\t}\n\n\tif len(missing) != 0 {\n\t\tflat := make([]string, 0, len(missing))\n\t\tfor k := range missing {\n\t\t\tflat = append(flat, k)\n\t\t}\n\n\t\treturn fmt.Errorf(\"Dispatch did not provide required meta keys: %v\", flat)\n\t}\n\n\t// Confirm that Priority is appropriately set on the JobDispatchRequest\n\tif req.Priority < structs.JobMinPriority || req.Priority > config.JobMaxPriority {\n\t\treturn fmt.Errorf(\"dispatch job priority must be between [%d, %d]\", structs.JobMinPriority, config.JobMaxPriority)\n\t}\n\n\treturn nil\n}\n\n// ScaleStatus retrieves the scaling status for a job\nfunc (j *Job) ScaleStatus(args *structs.JobScaleStatusRequest,\n\treply *structs.JobScaleStatusResponse) error {\n\n\tauthErr := j.srv.Authenticate(j.ctx, args)\n\tif done, err := j.srv.forward(\"Job.ScaleStatus\", args, args, reply); done {\n\t\treturn err\n\t}\n\tj.srv.MeasureRPCRate(\"job\", structs.RateMetricRead, args)\n\tif authErr != nil {\n\t\treturn structs.ErrPermissionDenied\n\t}\n\tdefer metrics.MeasureSince([]string{\"nomad\", \"job\", \"scale_status\"}, time.Now())","sourceCodeStart":2177,"sourceCodeEnd":2213,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/job_endpoint.go#L2177-L2213","documentation":"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.","triggerScenarios":"Thrown at nomad/job_endpoint.go:2195 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Omit -priority on nomad job dispatch to use the job default","Choose a priority within [1, configured job_max_priority]"],"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"}