{"id":"5627b3e3c2d76792","repo":"docker/cli","slug":"unrecognized-service-mode","errorCode":null,"errorMessage":"unrecognized service mode","messagePattern":"unrecognized service mode","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/command/service/progress/progress.go","lineNumber":253,"sourceCode":"\tif service.Spec.Mode.Replicated != nil && service.Spec.Mode.Replicated.Replicas != nil {\n\t\treturn &replicatedProgressUpdater{\n\t\t\tprogressOut: progressOut,\n\t\t}, nil\n\t}\n\tif service.Spec.Mode.Global != nil {\n\t\treturn &globalProgressUpdater{\n\t\t\tprogressOut: progressOut,\n\t\t}, nil\n\t}\n\tif service.Spec.Mode.ReplicatedJob != nil {\n\t\treturn newReplicatedJobProgressUpdater(service, progressOut), nil\n\t}\n\tif service.Spec.Mode.GlobalJob != nil {\n\t\treturn &globalJobProgressUpdater{\n\t\t\tprogressOut: progressOut,\n\t\t}, nil\n\t}\n\treturn nil, errors.New(\"unrecognized service mode\")\n}\n\nfunc writeOverallProgress(progressOut progress.Output, numerator, denominator int, rollback bool) {\n\tif rollback {\n\t\tprogressOut.WriteProgress(progress.Progress{\n\t\t\tID:     \"overall progress\",\n\t\t\tAction: fmt.Sprintf(\"rolling back update: %d out of %d tasks\", numerator, denominator),\n\t\t})\n\t\treturn\n\t}\n\tprogressOut.WriteProgress(progress.Progress{\n\t\tID:     \"overall progress\",\n\t\tAction: fmt.Sprintf(\"%d out of %d tasks\", numerator, denominator),\n\t})\n}\n\nfunc truncError(errMsg string) string {\n\t// Remove newlines from the error, which corrupt the output.","sourceCodeStart":235,"sourceCodeEnd":271,"githubUrl":"https://github.com/docker/cli/blob/e9452d6e785f6e365712b9d71bd7517591773c86/cli/command/service/progress/progress.go#L235-L271","documentation":"Returned by initializeUpdater in the service progress reporter when a service's Spec.Mode matches none of the four known variants (Replicated with non-nil Replicas, Global, ReplicatedJob, GlobalJob). The CLI cannot render deployment progress for a mode it doesn't recognize, so it fails fast instead of showing bogus progress.","triggerScenarios":"docker service create/update with --detach=false (progress display) against a service whose inspected Mode struct has no recognized branch set — e.g. a newer daemon returning a mode this CLI version predates, a Replicated mode with a nil Replicas pointer from a nonstandard API client, or a hand-crafted service spec with an empty Mode.","commonSituations":"CLI/daemon version skew where the daemon supports a newer service mode; third-party tools creating services via the API with an incomplete ServiceMode; corrupted or mocked inspect responses in tests.","solutions":["Upgrade the Docker CLI so it recognizes the service's mode (check with `docker service inspect <svc> --format '{{json .Spec.Mode}}'`).","If a custom API client created the service, ensure exactly one of Replicated (with Replicas set), Global, ReplicatedJob, or GlobalJob is populated in ServiceMode.","As a workaround, run the command with --detach to skip progress monitoring."],"exampleFix":"// before (custom API client)\nspec.Mode = swarm.ServiceMode{}\n// after\nreplicas := uint64(3)\nspec.Mode = swarm.ServiceMode{Replicated: &swarm.ReplicatedService{Replicas: &replicas}}","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":["docker","swarm","cli","progress","version-skew","service-mode"],"analyzedSha":"e9452d6e785f6e365712b9d71bd7517591773c86","analyzedAt":"2026-08-01T07:09:22.474Z","schemaVersion":2}