{"record":{"id":"444bf9f582f7d94e","repo":"hashicorp/nomad","slug":"cannot-update-periodic-job-to-being-non-periodic","errorCode":null,"errorMessage":"cannot update periodic job to being non-periodic","messagePattern":"cannot update periodic job to being non-periodic","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/job_endpoint.go","lineNumber":1962,"sourceCode":"\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\n\tif old.IsParameterized() && !new.IsParameterized() {\n\t\treturn fmt.Errorf(\"cannot update parameterized job to being non-parameterized\")\n\t}\n\tif new.IsParameterized() && !old.IsParameterized() {\n\t\treturn fmt.Errorf(\"cannot update non-parameterized job to being parameterized\")\n\t}\n\n\tif old.Dispatched != new.Dispatched {\n\t\treturn fmt.Errorf(\"field 'Dispatched' is read-only\")\n\t}\n\n\treturn nil","sourceCodeStart":1944,"sourceCodeEnd":1980,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/job_endpoint.go#L1944-L1980","documentation":"Fires in validateJobUpdate when updating a job that was periodic into one whose spec no longer enables periodic scheduling; the periodic/non-periodic divide cannot be crossed on update.","triggerScenarios":"Thrown at nomad/job_endpoint.go:1962 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Keep the periodic block enabled in the updated job","Create a new job if periodic behavior is no longer wanted"],"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"}