{"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/e9452d6e785f6e365712b9d71bd7517591773c86/opts/mount.go#L85-L121","documentation":"Error \"invalid value for %s: %s (must be \"enabled\", \"disabled\", \"writable\", or \"readonly\")\" thrown in docker/cli.","triggerScenarios":"Thrown at opts/mount.go:103 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}