docker/cli ยท error

update and rollback configuration is not supported for jobs

Error message

update and rollback configuration is not supported for jobs

What it means

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.

Source

Thrown at cli/command/service/opts.go:737

	healthConfig, err := options.healthcheck.toHealthConfig()
	if err != nil {
		return service, err
	}

	serviceMode, err := options.ToServiceMode()
	if err != nil {
		return service, err
	}

	updateConfig := options.update.updateConfig(flags)
	rollbackConfig := options.rollback.rollbackConfig(flags)

	// update and rollback configuration is not supported for jobs. If these
	// flags are not set, then the values will be nil. If they are non-nil,
	// then return an error.
	if (serviceMode.ReplicatedJob != nil || serviceMode.GlobalJob != nil) && (updateConfig != nil || rollbackConfig != nil) {
		return service, errors.New("update and rollback configuration is not supported for jobs")
	}

	networks := convertNetworks(options.networks)
	for i, net := range networks {
		nwID, err := resolveNetworkID(ctx, apiClient, net.Target)
		if err != nil {
			return service, err
		}
		networks[i].Target = nwID
	}
	sort.Slice(networks, func(i, j int) bool {
		return networks[i].Target < networks[j].Target
	})

	resources, err := options.resources.ToResourceRequirements(flags)
	if err != nil {
		return service, err
	}

View on GitHub (pinned to e9452d6e78)

Solutions

  1. Remove all --update-* and --rollback-* flags from job-mode service commands.
  2. If the workload genuinely needs rolling updates/rollbacks, model it as a regular replicated or global service instead of a job.
  3. To re-run a job with new parameters, update only the non-update/rollback fields (e.g. --image), which forces a new job iteration.

Example fix

# before
docker service create --mode replicated-job --replicas 4 --update-parallelism 2 my-job
# after
docker service create --mode replicated-job --replicas 4 my-job

When it happens

Trigger: `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.

Common situations: 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.

Related errors


AI-assisted analysis of docker/cli@e9452d6e78 (2026-08-01). Data as JSON: /data/errors/7eeea0bf992a5aa1.json. Report an issue: GitHub.