{"id":"4787475ee51606bf","repo":"docker/cli","slug":"s-invalid-replicas-value-s-v","errorCode":null,"errorMessage":"%s: invalid replicas value %s: %v","messagePattern":"(.+?): invalid replicas value (.+?): (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/command/service/scale.go","lineNumber":69,"sourceCode":"\t\t\t)\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc runScale(ctx context.Context, dockerCLI command.Cli, options *scaleOptions, args []string) error {\n\tapiClient := dockerCLI.Client()\n\tvar (\n\t\terrs       []error\n\t\tserviceIDs = make([]string, 0, len(args))\n\t)\n\tfor _, arg := range args {\n\t\tserviceID, scaleStr, _ := strings.Cut(arg, \"=\")\n\n\t\t// validate input arg scale number\n\t\tscale, err := strconv.ParseUint(scaleStr, 10, 64)\n\t\tif err != nil {\n\t\t\terrs = append(errs, fmt.Errorf(\"%s: invalid replicas value %s: %v\", serviceID, scaleStr, err))\n\t\t\tcontinue\n\t\t}\n\n\t\twarnings, err := runServiceScale(ctx, apiClient, serviceID, scale)\n\t\tif err != nil {\n\t\t\terrs = append(errs, fmt.Errorf(\"%s: %v\", serviceID, err))\n\t\t\tcontinue\n\t\t}\n\t\tfor _, warning := range warnings {\n\t\t\t_, _ = fmt.Fprintln(dockerCLI.Err(), warning)\n\t\t}\n\t\t_, _ = fmt.Fprintf(dockerCLI.Out(), \"%s scaled to %d\\n\", serviceID, scale)\n\t\tserviceIDs = append(serviceIDs, serviceID)\n\t}\n\n\tif len(serviceIDs) > 0 && !options.detach {\n\t\tfor _, serviceID := range serviceIDs {\n\t\t\tif err := WaitOnService(ctx, dockerCLI, serviceID, false); err != nil {","sourceCodeStart":51,"sourceCodeEnd":87,"githubUrl":"https://github.com/docker/cli/blob/e9452d6e785f6e365712b9d71bd7517591773c86/cli/command/service/scale.go#L51-L87","documentation":"Error \"%s: invalid replicas value %s: %v\" thrown in docker/cli.","triggerScenarios":"Thrown at cli/command/service/scale.go:69 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"e9452d6e785f6e365712b9d71bd7517591773c86","analyzedAt":"2026-08-01T07:09:22.474Z","schemaVersion":2}