{"record":{"id":"db14fb31b99701b1","repo":"docker/cli","slug":"invalid-value-for-s-s","errorCode":null,"errorMessage":"invalid value for %s: %s","messagePattern":"invalid value for (.+?): (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"opts/mount.go","lineNumber":130,"sourceCode":"\t\tcase \"volume-nocopy\":\n\t\t\tensureVolumeOptions(&mount).NoCopy, err = parseBoolValue(key, val, hasValue)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\tcase \"volume-label\":\n\t\t\tvolumeOpts := ensureVolumeOptions(&mount)\n\t\t\tvolumeOpts.Labels = setValueOnMap(volumeOpts.Labels, val)\n\t\tcase \"volume-driver\":\n\t\t\tensureVolumeDriver(&mount).Name = val\n\t\tcase \"volume-opt\":\n\t\t\tvolumeDriver := ensureVolumeDriver(&mount)\n\t\t\tvolumeDriver.Options = setValueOnMap(volumeDriver.Options, val)\n\t\tcase \"image-subpath\":\n\t\t\tensureImageOptions(&mount).Subpath = val\n\t\tcase \"tmpfs-size\":\n\t\t\tsizeBytes, err := units.RAMInBytes(val)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"invalid value for %s: %s\", key, val)\n\t\t\t}\n\t\t\tensureTmpfsOptions(&mount).SizeBytes = sizeBytes\n\t\tcase \"tmpfs-mode\":\n\t\t\tui64, err := strconv.ParseUint(val, 8, 32)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"invalid value for %s: %s\", key, val)\n\t\t\t}\n\t\t\tensureTmpfsOptions(&mount).Mode = os.FileMode(ui64)\n\t\tdefault:\n\t\t\treturn fmt.Errorf(\"unknown option '%s' in '%s'\", key, field)\n\t\t}\n\t}\n\n\tif err := validateMountOptions(&mount); err != nil {\n\t\treturn err\n\t}\n\n\tm.values = append(m.values, mount)","sourceCodeStart":112,"sourceCodeEnd":148,"githubUrl":"https://github.com/docker/cli/blob/4f84911bfe8811e9b028e4b1fee8e7510be79387/opts/mount.go#L112-L148","documentation":"Returned by MountOpt.Set (opts/mount.go:130) when the `tmpfs-size` option's value cannot be parsed by go-units' RAMInBytes. The size must be a number optionally followed by a binary/decimal unit suffix (e.g. 1000000, 64m, 2g). A malformed or empty suffix causes RAMInBytes to error and this message wraps it.","triggerScenarios":"Passing `tmpfs-size=` (empty — though that's caught earlier), `tmpfs-size=abc`, `tmpfs-size=1.5g` (fractional sizes rejected by RAMInBytes), or a non-existent unit suffix.","commonSituations":"Using uppercase `64M` is fine, but fractional values, typos like `64mb`, or locale-specific decimals fail.","solutions":["Use an integer with an accepted suffix: tmpfs-size=64m or tmpfs-size=1073741824.","Avoid fractional sizes (1.5g); round to a whole unit.","Confirm the suffix is one go-units accepts: k/kb/m/mb/g/gb/t/tb (case-insensitive, base 1024 by default)."],"exampleFix":"// before\n--mount \"type=tmpfs,destination=/cache,tmpfs-size=1.5g\"\n\n// after\n--mount \"type=tmpfs,destination=/cache,tmpfs-size=2g\"","handlingStrategy":"validation","validationCode":"func validateTmpfsSize(v string) error {\n    if _, err := units.RAMInBytes(v); err != nil {\n        return fmt.Errorf(\"invalid tmpfs-size %q: %w\", v, err)\n    }\n    return nil\n}","typeGuard":null,"tryCatchPattern":"if err := m.Set(spec); err != nil {\n    return fmt.Errorf(\"mount %q: %w\", spec, err)\n}","preventionTips":["Use integer sizes with k/m/g suffixes (case-insensitive).","Avoid fractional sizes like 1.5g.","Validate sizes in your mount-spec builder before emitting CSV."],"tags":["mount","docker","tmpfs","size","validation"],"backgroundTag":null,"analyzedSha":"4f84911bfe8811e9b028e4b1fee8e7510be79387","analyzedAt":"2026-08-07T12:15:29.814Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}