{"id":"cb9a941580c3fe13","repo":"docker/cli","slug":"invalid-value-for-s-in-s-value-should-not-h","errorCode":null,"errorMessage":"invalid value for '%s' in '%s': value should not have whitespace","messagePattern":"invalid value for '(.+?)' in '(.+?)': value should not have whitespace","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"opts/mount.go","lineNumber":51,"sourceCode":"\t\treturn err\n\t}\n\n\tmount := mounttypes.Mount{\n\t\tType: mounttypes.TypeVolume, // default to volume mounts\n\t}\n\n\tfor _, field := range fields {\n\t\tkey, val, hasValue := strings.Cut(field, \"=\")\n\t\tif k := strings.TrimSpace(key); k != key {\n\t\t\treturn fmt.Errorf(\"invalid option '%s' in '%s': option should not have whitespace\", k, field)\n\t\t}\n\t\tif hasValue {\n\t\t\tv := strings.TrimSpace(val)\n\t\t\tif v == \"\" {\n\t\t\t\treturn fmt.Errorf(\"invalid value for '%s': value is empty\", key)\n\t\t\t}\n\t\t\tif v != val {\n\t\t\t\treturn fmt.Errorf(\"invalid value for '%s' in '%s': value should not have whitespace\", key, field)\n\t\t\t}\n\t\t}\n\n\t\t// TODO(thaJeztah): these options should not be case-insensitive.\n\t\tkey = strings.ToLower(key)\n\n\t\tif !hasValue {\n\t\t\tswitch key {\n\t\t\tcase \"readonly\", \"ro\", \"volume-nocopy\", \"bind-nonrecursive\", \"bind-create-src\":\n\t\t\t\t// boolean values\n\t\t\tdefault:\n\t\t\t\treturn fmt.Errorf(\"invalid field '%s' must be a key=value pair\", field)\n\t\t\t}\n\t\t}\n\n\t\tswitch key {\n\t\tcase \"type\":\n\t\t\tmount.Type = mounttypes.Type(strings.ToLower(val))","sourceCodeStart":33,"sourceCodeEnd":69,"githubUrl":"https://github.com/docker/cli/blob/e9452d6e785f6e365712b9d71bd7517591773c86/opts/mount.go#L33-L69","documentation":"Error \"invalid value for '%s' in '%s': value should not have whitespace\" thrown in docker/cli.","triggerScenarios":"Thrown at opts/mount.go:51 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}