{"record":{"id":"0bb9c5ab7c2229f7","repo":"docker/cli","slug":"invalid-value-for-s-s-must-be-enabled-disa","errorCode":null,"errorMessage":"invalid value for %s: %s (must be \"enabled\", \"disabled\", \"writable\", or \"readonly\")","messagePattern":"invalid value for (.+?): (.+?) \\(must be \"enabled\", \"disabled\", \"writable\", or \"readonly\"\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"opts/mount.go","lineNumber":103,"sourceCode":"\t\t\tmount.Consistency = mounttypes.Consistency(strings.ToLower(val))\n\t\tcase \"bind-propagation\":\n\t\t\tensureBindOptions(&mount).Propagation = mounttypes.Propagation(strings.ToLower(val))\n\t\tcase \"bind-nonrecursive\":\n\t\t\treturn errors.New(\"bind-nonrecursive is deprecated, use bind-recursive=disabled instead\")\n\t\tcase \"bind-recursive\":\n\t\t\tswitch val {\n\t\t\tcase \"enabled\": // read-only mounts are recursively read-only if Engine >= v25 && kernel >= v5.12, otherwise writable\n\t\t\t\t// NOP\n\t\t\tcase \"disabled\": // previously \"bind-nonrecursive=true\"\n\t\t\t\tensureBindOptions(&mount).NonRecursive = true\n\t\t\tcase \"writable\": // conforms to the default read-only bind-mount of Docker v24; read-only mounts are recursively mounted but not recursively read-only\n\t\t\t\tensureBindOptions(&mount).ReadOnlyNonRecursive = true\n\t\t\tcase \"readonly\": // force recursively read-only, or raise an error\n\t\t\t\tensureBindOptions(&mount).ReadOnlyForceRecursive = true\n\t\t\t\t// TODO: implicitly set propagation and error if the user specifies a propagation in a future refactor/UX polish pass\n\t\t\t\t// https://github.com/docker/cli/pull/4316#discussion_r1341974730\n\t\t\tdefault:\n\t\t\t\treturn fmt.Errorf(`invalid value for %s: %s (must be \"enabled\", \"disabled\", \"writable\", or \"readonly\")`, key, val)\n\t\t\t}\n\t\tcase \"bind-create-src\":\n\t\t\tensureBindOptions(&mount).CreateMountpoint, 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-subpath\":\n\t\t\tensureVolumeOptions(&mount).Subpath = val\n\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","sourceCodeStart":85,"sourceCodeEnd":121,"githubUrl":"https://github.com/docker/cli/blob/4f84911bfe8811e9b028e4b1fee8e7510be79387/opts/mount.go#L85-L121","documentation":"Returned by MountOpt.Set (opts/mount.go:103) when the `bind-recursive` option receives a value other than the four allowed: enabled, disabled, writable, readonly. Each maps to a distinct recursive-bind behavior (full recursion, no recursion, writable-non-recursive, force-recursive-read-only), so an unknown value cannot be mapped.","triggerScenarios":"Passing `bind-recursive=true`, `bind-recursive=yes`, `bind-recursive=1`, or any typo'd/uppercase variant (note values are not lowercased, so `Enabled` also fails).","commonSituations":"Migrating from the deprecated `bind-nonrecursive` and guessing the replacement's vocabulary, using boolean-style values, or case mismatch.","solutions":["Use one of the exact lowercase values: enabled, disabled, writable, readonly.","For the old bind-nonrecursive=true behavior, use bind-recursive=disabled.","Remember readonly/writable variants additionally require the readonly option (validated later in validateMountOptions)."],"exampleFix":"// before\n--mount \"type=bind,source=/data,target=/data,bind-recursive=true\"\n\n// after\n--mount \"type=bind,source=/data,target=/data,readonly,bind-recursive=readonly\"","handlingStrategy":"validation","validationCode":"var bindRecursiveValues = map[string]bool{\"enabled\": true, \"disabled\": true, \"writable\": true, \"readonly\": true}\n\nfunc validateBindRecursive(v string) error {\n    if !bindRecursiveValues[v] {\n        return fmt.Errorf(\"bind-recursive must be one of enabled, disabled, writable, readonly; got %q\", v)\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 the exact lowercase vocabulary; values are case-sensitive.","Remember readonly/writable also require the readonly option.","Migrate bind-nonrecursive=true to bind-recursive=disabled."],"tags":["mount","docker","bind","validation","configuration"],"backgroundTag":null,"analyzedSha":"4f84911bfe8811e9b028e4b1fee8e7510be79387","analyzedAt":"2026-08-07T12:15:29.814Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}