{"id":"4af858c7caa4c1db","repo":"docker/cli","slug":"invalid-value-for-s-invalid-boolean-value-q","errorCode":null,"errorMessage":"invalid value for '%s': invalid boolean value (%q): must be one of \"true\", \"1\", \"false\", or \"0\" (default \"true\")","messagePattern":"invalid value for '(.+?)': invalid boolean value \\(%q\\): must be one of \"true\", \"1\", \"false\", or \"0\" \\(default \"true\"\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"opts/mount_utils.go","lineNumber":85,"sourceCode":"\treturn nil\n}\n\n// parseBoolValue returns the boolean value represented by the string. It returns\n// true if no value is set.\n//\n// It is similar to [strconv.ParseBool], but only accepts 1, true, 0, false.\n// Any other value returns an error.\nfunc parseBoolValue(key string, val string, hasValue bool) (bool, error) {\n\tif !hasValue {\n\t\treturn true, nil\n\t}\n\tswitch val {\n\tcase \"1\", \"true\":\n\t\treturn true, nil\n\tcase \"0\", \"false\":\n\t\treturn false, nil\n\tdefault:\n\t\treturn false, fmt.Errorf(`invalid value for '%s': invalid boolean value (%q): must be one of \"true\", \"1\", \"false\", or \"0\" (default \"true\")`, key, val)\n\t}\n}\n\nfunc ensureVolumeOptions(m *mount.Mount) *mount.VolumeOptions {\n\tif m.VolumeOptions == nil {\n\t\tm.VolumeOptions = &mount.VolumeOptions{}\n\t}\n\treturn m.VolumeOptions\n}\n\nfunc ensureVolumeDriver(m *mount.Mount) *mount.Driver {\n\tensureVolumeOptions(m)\n\tif m.VolumeOptions.DriverConfig == nil {\n\t\tm.VolumeOptions.DriverConfig = &mount.Driver{}\n\t}\n\treturn m.VolumeOptions.DriverConfig\n}\n","sourceCodeStart":67,"sourceCodeEnd":103,"githubUrl":"https://github.com/docker/cli/blob/e9452d6e785f6e365712b9d71bd7517591773c86/opts/mount_utils.go#L67-L103","documentation":"Error \"invalid value for '%s': invalid boolean value (%q): must be one of \"true\", \"1\", \"false\", or \"0\" (default \"true\")\" thrown in docker/cli.","triggerScenarios":"Thrown at opts/mount_utils.go:85 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}