{"id":"ad66a5bdf8cb6503","repo":"docker/cli","slug":"invalid-value-d-valid-memory-swappiness-range-i","errorCode":null,"errorMessage":"invalid value: %d. Valid memory swappiness range is 0-100","messagePattern":"invalid value: (.+?)\\. Valid memory swappiness range is 0-100","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/command/container/opts.go","lineNumber":368,"sourceCode":"\tif copts.macAddress != \"\" {\n\t\tif _, err := net.ParseMAC(strings.TrimSpace(copts.macAddress)); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"%s is not a valid mac address\", copts.macAddress)\n\t\t}\n\t}\n\tif copts.stdin {\n\t\tattachStdin = true\n\t}\n\t// If -a is not set, attach to stdout and stderr\n\tif copts.attach.Len() == 0 {\n\t\tattachStdout = true\n\t\tattachStderr = true\n\t}\n\n\tvar err error\n\n\tswappiness := copts.swappiness\n\tif swappiness != -1 && (swappiness < 0 || swappiness > 100) {\n\t\treturn nil, fmt.Errorf(\"invalid value: %d. Valid memory swappiness range is 0-100\", swappiness)\n\t}\n\n\tvar binds []string\n\tvolumes := copts.volumes.GetMap()\n\t// add any bind targets to the list of container volumes\n\tfor bind := range volumes {\n\t\tparsed, err := volumespec.Parse(bind)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tif parsed.Source != \"\" {\n\t\t\ttoBind := bind\n\n\t\t\tif parsed.Type == string(mount.TypeBind) {\n\t\t\t\tif hostPart, targetPath, ok := strings.Cut(bind, \":\"); ok {\n\t\t\t\t\tif !filepath.IsAbs(hostPart) && strings.HasPrefix(hostPart, \".\") {\n\t\t\t\t\t\tif absHostPart, err := filepath.Abs(hostPart); err == nil {","sourceCodeStart":350,"sourceCodeEnd":386,"githubUrl":"https://github.com/docker/cli/blob/e9452d6e785f6e365712b9d71bd7517591773c86/cli/command/container/opts.go#L350-L386","documentation":"Error \"invalid value: %d. Valid memory swappiness range is 0-100\" thrown in docker/cli.","triggerScenarios":"Thrown at cli/command/container/opts.go:368 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}