{"id":"7eeea0bf992a5aa1","repo":"docker/cli","slug":"update-and-rollback-configuration-is-not-supported","errorCode":null,"errorMessage":"update and rollback configuration is not supported for jobs","messagePattern":"update and rollback configuration is not supported for jobs","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/command/service/opts.go","lineNumber":737,"sourceCode":"\n\thealthConfig, err := options.healthcheck.toHealthConfig()\n\tif err != nil {\n\t\treturn service, err\n\t}\n\n\tserviceMode, err := options.ToServiceMode()\n\tif err != nil {\n\t\treturn service, err\n\t}\n\n\tupdateConfig := options.update.updateConfig(flags)\n\trollbackConfig := options.rollback.rollbackConfig(flags)\n\n\t// update and rollback configuration is not supported for jobs. If these\n\t// flags are not set, then the values will be nil. If they are non-nil,\n\t// then return an error.\n\tif (serviceMode.ReplicatedJob != nil || serviceMode.GlobalJob != nil) && (updateConfig != nil || rollbackConfig != nil) {\n\t\treturn service, errors.New(\"update and rollback configuration is not supported for jobs\")\n\t}\n\n\tnetworks := convertNetworks(options.networks)\n\tfor i, net := range networks {\n\t\tnwID, err := resolveNetworkID(ctx, apiClient, net.Target)\n\t\tif err != nil {\n\t\t\treturn service, err\n\t\t}\n\t\tnetworks[i].Target = nwID\n\t}\n\tsort.Slice(networks, func(i, j int) bool {\n\t\treturn networks[i].Target < networks[j].Target\n\t})\n\n\tresources, err := options.resources.ToResourceRequirements(flags)\n\tif err != nil {\n\t\treturn service, err\n\t}","sourceCodeStart":719,"sourceCodeEnd":755,"githubUrl":"https://github.com/docker/cli/blob/e9452d6e785f6e365712b9d71bd7517591773c86/cli/command/service/opts.go#L719-L755","documentation":"Raised in serviceOptions.ToService after the mode is resolved: if the resulting mode is a job (ReplicatedJob or GlobalJob) and any --update-* or --rollback-* flags were explicitly set (producing non-nil updateConfig/rollbackConfig), the CLI errors out. Jobs run to completion and are never rolling-updated or rolled back, so Swarm's UpdateConfig/RollbackConfig do not apply to them.","triggerScenarios":"`docker service create --mode replicated-job --update-parallelism 2 ...`, or any --update-delay/--update-order/--rollback-* flag combined with --mode replicated-job or global-job; also `docker service update` setting such flags on an existing job service.","commonSituations":"Reusing a service-deployment wrapper script (which sets update/rollback policy on everything) for batch jobs; compose-to-CLI translations carrying deploy.update_config into a job; expecting to control job re-runs via update flags.","solutions":["Remove all --update-* and --rollback-* flags from job-mode service commands.","If the workload genuinely needs rolling updates/rollbacks, model it as a regular replicated or global service instead of a job.","To re-run a job with new parameters, update only the non-update/rollback fields (e.g. --image), which forces a new job iteration."],"exampleFix":"# before\ndocker service create --mode replicated-job --replicas 4 --update-parallelism 2 my-job\n# after\ndocker service create --mode replicated-job --replicas 4 my-job","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":["docker","swarm","cli","jobs","update-config","flag-validation"],"analyzedSha":"e9452d6e785f6e365712b9d71bd7517591773c86","analyzedAt":"2026-08-01T07:09:22.474Z","schemaVersion":2}