{"record":{"id":"b670dc2e3025f54b","repo":"hashicorp/nomad","slug":"job-can-t-be-submitted-with-dispatched-set","errorCode":null,"errorMessage":"job can't be submitted with 'Dispatched' set","messagePattern":"job can't be submitted with 'Dispatched' set","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/job_endpoint.go","lineNumber":1950,"sourceCode":"\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"Failed to parse cron expression: %v\", err)\n\t\t}\n\t}\n\n\treply.FailedTGAllocs = updatedEval.FailedTGAllocs\n\treply.JobModifyIndex = index\n\treply.Annotations = annotations\n\treply.CreatedEvals = planner.CreateEvals\n\treply.Index = index\n\treturn nil\n}\n\n// validateJobUpdate ensures updates to a job are valid.\nfunc validateJobUpdate(old, new *structs.Job) error {\n\t// Validate Dispatch not set on new Jobs\n\tif old == nil {\n\t\tif new.Dispatched {\n\t\t\treturn fmt.Errorf(\"job can't be submitted with 'Dispatched' set\")\n\t\t}\n\t\treturn nil\n\t}\n\n\t// Type transitions are disallowed\n\tif old.Type != new.Type {\n\t\treturn fmt.Errorf(\"cannot update job from type %q to %q\", old.Type, new.Type)\n\t}\n\n\t// Transitioning to/from periodic is disallowed\n\tif old.IsPeriodic() && !new.IsPeriodic() {\n\t\treturn fmt.Errorf(\"cannot update periodic job to being non-periodic\")\n\t}\n\tif new.IsPeriodic() && !old.IsPeriodic() {\n\t\treturn fmt.Errorf(\"cannot update non-periodic job to being periodic\")\n\t}\n\n\t// Transitioning to/from parameterized is disallowed","sourceCodeStart":1932,"sourceCodeEnd":1968,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/job_endpoint.go#L1932-L1968","documentation":"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.","triggerScenarios":"Thrown at nomad/job_endpoint.go:1950 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove the Dispatched field from the job spec","Use nomad job dispatch on a parameterized job to obtain dispatched child jobs"],"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"}