{"id":"c906a1b9cfde2054","repo":"docker/cli","slug":"invalid-count-s-value-must-be-either-all-or","errorCode":null,"errorMessage":"invalid count (%s): value must be either \"all\" or an integer: %w","messagePattern":"invalid count \\((.+?)\\): value must be either \"all\" or an integer: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"opts/gpus.go","lineNumber":28,"sourceCode":"\t\"github.com/moby/moby/api/types/container\"\n)\n\n// GpuOpts is a Value type for parsing mounts\ntype GpuOpts struct {\n\tvalues []container.DeviceRequest\n}\n\nfunc parseCount(s string) (int, error) {\n\tif s == \"all\" {\n\t\treturn -1, nil\n\t}\n\ti, err := strconv.Atoi(s)\n\tif err != nil {\n\t\tvar numErr *strconv.NumError\n\t\tif errors.As(err, &numErr) {\n\t\t\terr = numErr.Err\n\t\t}\n\t\treturn 0, fmt.Errorf(`invalid count (%s): value must be either \"all\" or an integer: %w`, s, err)\n\t}\n\treturn i, nil\n}\n\n// Set a new mount value\n//\n//nolint:gocyclo\nfunc (o *GpuOpts) Set(value string) error {\n\tcsvReader := csv.NewReader(strings.NewReader(value))\n\tfields, err := csvReader.Read()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treq := container.DeviceRequest{}\n\n\tseen := map[string]struct{}{}\n\t// Set writable as the default","sourceCodeStart":10,"sourceCodeEnd":46,"githubUrl":"https://github.com/docker/cli/blob/e9452d6e785f6e365712b9d71bd7517591773c86/opts/gpus.go#L10-L46","documentation":"Error \"invalid count (%s): value must be either \"all\" or an integer: %w\" thrown in docker/cli.","triggerScenarios":"Thrown at opts/gpus.go:28 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}