docker/cli ยท error
unknown mode: %s, only replicated and global supported
Error message
unknown mode: %s, only replicated and global supported
What it means
Error "unknown mode: %s, only replicated and global supported" thrown in docker/cli.
Source
Thrown at cli/command/service/opts.go:669
concurrent = options.replicas.Value()
}
serviceMode.ReplicatedJob = &swarm.ReplicatedJob{
MaxConcurrent: concurrent,
TotalCompletions: options.replicas.Value(),
}
case "global-job":
if options.maxReplicas > 0 {
return serviceMode, errors.New("replicas-max-per-node can only be used with replicated or replicated-job mode")
}
if options.maxConcurrent.Value() != nil {
return serviceMode, errors.New("max-concurrent can only be used with replicated-job mode")
}
if options.replicas.Value() != nil {
return serviceMode, errors.New("replicas can only be used with replicated or replicated-job mode")
}
serviceMode.GlobalJob = &swarm.GlobalJob{}
default:
return serviceMode, fmt.Errorf("unknown mode: %s, only replicated and global supported", options.mode)
}
return serviceMode, nil
}
func (options *serviceOptions) ToStopGracePeriod(flags *pflag.FlagSet) *time.Duration {
if flags.Changed(flagStopGracePeriod) {
return options.stopGrace.Value()
}
return nil
}
// makeEnv gets the environment variables from the command line options and
// returns a slice of strings to use in the service spec when doing ToService
func (options *serviceOptions) makeEnv() ([]string, error) {
envVariables, err := opts.ReadKVEnvStrings(options.envFile.GetSlice(), options.env.GetSlice())
if err != nil {
return nil, err
}View on GitHub (pinned to e9452d6e78)
When it happens
Trigger: Thrown at cli/command/service/opts.go:669 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of docker/cli@e9452d6e78 (2026-08-01).
Data as JSON: /data/errors/2b2cac39a8d444b3.json.
Report an issue: GitHub.