{"record":{"id":"1cf678e518d54c68","repo":"docker/cli","slug":"unknown-option-s-in-s","errorCode":null,"errorMessage":"unknown option '%s' in '%s'","messagePattern":"unknown option '(.+?)' in '(.+?)'","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"opts/mount.go","lineNumber":140,"sourceCode":"\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)\n\treturn nil\n}\n\n// Type returns the type of this option\nfunc (*MountOpt) Type() string {\n\treturn \"mount\"\n}\n\n// String returns a string repr of this option\nfunc (m *MountOpt) String() string {","sourceCodeStart":122,"sourceCodeEnd":158,"githubUrl":"https://github.com/docker/cli/blob/4f84911bfe8811e9b028e4b1fee8e7510be79387/opts/mount.go#L122-L158","documentation":"Returned by MountOpt.Set (opts/mount.go:140) when a mount option key matches none of the recognized cases. The key (lowercased) is switched against the full known set (type, source/src, target/dst/destination, readonly/ro, consistency, bind-propagation, bind-recursive, bind-create-src, volume-subpath, volume-nocopy, volume-label, volume-driver, volume-opt, image-subpath, tmpfs-size, tmpfs-mode); anything else falls to default and is rejected.","triggerScenarios":"Passing a typo or unsupported option: `src`, `destintion`, `read-only`, `volume-copy`, `tmpfs-uid`, `propagation`, or an Engine version's option not implemented by this CLI version.","commonSituations":"Misspelling an option name, using a hyphen vs underscore mismatch, or referencing a daemon option that the CLI opts layer does not surface.","solutions":["Check the spelling against the supported mount options and use aliases (src for source, dst/destination for target).","Confirm the option exists in your CLI version — newer daemon options may not be parsed yet.","Remove the unsupported field; some options belong in the daemon config, not the mount spec."],"exampleFix":"// before\n--mount \"type=bind,src=/data,dest=/data,read-only=true\"\n\n// after\n--mount \"type=bind,source=/data,target=/data,readonly\"","handlingStrategy":"validation","validationCode":"var knownMountKeys = map[string]bool{\n    \"type\": true, \"source\": true, \"src\": true, \"target\": true, \"dst\": true, \"destination\": true,\n    \"readonly\": true, \"ro\": true, \"consistency\": true, \"bind-propagation\": true, \"bind-recursive\": true,\n    \"bind-create-src\": true, \"volume-subpath\": true, \"volume-nocopy\": true, \"volume-label\": true,\n    \"volume-driver\": true, \"volume-opt\": true, \"image-subpath\": true, \"tmpfs-size\": true, \"tmpfs-mode\": true,\n}\n\nfunc validateKnownKeys(spec string) error {\n    r := csv.NewReader(strings.NewReader(spec))\n    fields, err := r.Read()\n    if err != nil {\n        return err\n    }\n    for _, f := range fields {\n        k, _, _ := strings.Cut(f, \"=\")\n        if !knownMountKeys[strings.ToLower(k)] {\n            return fmt.Errorf(\"unknown mount option %q\", k)\n        }\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":["Build mounts from a typed struct and only emit known keys.","Check the CLI version supports an option before emitting it.","Use canonical aliases consistently (source/target)."],"tags":["mount","docker","unknown-option","validation"],"backgroundTag":null,"analyzedSha":"4f84911bfe8811e9b028e4b1fee8e7510be79387","analyzedAt":"2026-08-07T12:15:29.814Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}