{"id":"d28a304f6c9219cc","repo":"docker/cli","slug":"invalid-field-s-must-be-a-key-value-pair-d28a30","errorCode":null,"errorMessage":"invalid field '%s' must be a key=value pair","messagePattern":"invalid field '(.+?)' must be a key=value pair","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"opts/mount.go","lineNumber":63,"sourceCode":"\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))\n\t\tcase \"source\", \"src\":\n\t\t\tmount.Source = val\n\t\t\tif !filepath.IsAbs(val) && strings.HasPrefix(val, \".\") {\n\t\t\t\tif abs, err := filepath.Abs(val); err == nil {\n\t\t\t\t\tmount.Source = abs\n\t\t\t\t}\n\t\t\t}\n\t\tcase \"target\", \"dst\", \"destination\":\n\t\t\tmount.Target = val\n\t\tcase \"readonly\", \"ro\":\n\t\t\tmount.ReadOnly, err = parseBoolValue(key, val, hasValue)\n\t\t\tif err != nil {","sourceCodeStart":45,"sourceCodeEnd":81,"githubUrl":"https://github.com/docker/cli/blob/e9452d6e785f6e365712b9d71bd7517591773c86/opts/mount.go#L45-L81","documentation":"Error \"invalid field '%s' must be a key=value pair\" thrown in docker/cli.","triggerScenarios":"Thrown at opts/mount.go:63 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}