{"id":"84408f7ed3cd83fa","repo":"docker/cli","slug":"s-v","errorCode":null,"errorMessage":"%s: %v","messagePattern":"(.+?): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/command/service/scale.go","lineNumber":75,"sourceCode":"func 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 {\n\t\t\t\terrs = append(errs, fmt.Errorf(\"%s: %v\", serviceID, err))\n\t\t\t}\n\t\t}\n\t}\n\treturn errors.Join(errs...)\n}","sourceCodeStart":57,"sourceCodeEnd":93,"githubUrl":"https://github.com/docker/cli/blob/e9452d6e785f6e365712b9d71bd7517591773c86/cli/command/service/scale.go#L57-L93","documentation":"Error \"%s: %v\" thrown in docker/cli.","triggerScenarios":"Thrown at cli/command/service/scale.go:75 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}