{"record":{"id":"6baa49fe09de8af4","repo":"kubernetes/kops","slug":"found-multiple-packages-in-channel-for-name-q","errorCode":null,"errorMessage":"found multiple packages in channel for name=%q","messagePattern":"found multiple packages in channel for name=%q","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/apis/kops/channel.go","lineNumber":433,"sourceCode":"\t\t\t\tklog.Warningf(\"cannot parse KopsVersion=%q\", pkg.KopsVersion)\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif !kopsVersion.IsInRange(versionRange) {\n\t\t\t\tklog.V(2).Infof(\"kOps version %q does not match range: %s\", kopsVersion, pkg.KopsVersion)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\n\t\tmatches = append(matches, pkg)\n\t}\n\n\tif len(matches) == 0 {\n\t\treturn nil, fmt.Errorf(\"found no packages in channel for name=%q\", name)\n\t}\n\n\tif len(matches) != 1 {\n\t\treturn nil, fmt.Errorf(\"found multiple packages in channel for name=%q\", name)\n\t}\n\tv, err := util.ParseVersion(matches[0].Version)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error parsing version %q for package %q\", matches[0].Version, name)\n\t}\n\treturn v, nil\n}\n","sourceCodeStart":415,"sourceCodeEnd":441,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/pkg/apis/kops/channel.go#L415-L441","documentation":"GetPackageVersion resolves a package (addon) name to a version from the addons channel. After filtering channel packages by name, if more than one package entry matches, the function cannot determine which version to return and throws this error. The channel spec must contain at most one package entry per name.","triggerScenarios":"Calling GetPackageVersion (indirectly via CreateAddons during cluster apply/update) when the addons ChannelSpec contains two or more <name> package entries with the same name under addons.spec.packages (or via duplicate entries merged from channel overrides).","commonSituations":"Hand-edited or forked addons channel YAML with duplicated package entries; merging multiple channel sources that both define the same addon name; a typo making one entry collide with another name after lowercasing.","solutions":["Open the channel YAML used by the cluster and remove/merge duplicate package entries with the same name","If entries differ intentionally, rename or remove the obsolete addon entry so each name is unique","Regenerate or re-download the official kOps channel file instead of a hand-edited copy"],"exampleFix":"# before (channel.yaml)\naddons:\n  packages:\n    - name: kopsUrl\n      version: 1.28.0\n    - name: kopsUrl\n      version: 1.27.0\n# after\naddons:\n  packages:\n    - name: kopsUrl\n      version: 1.28.0","handlingStrategy":"validation","validationCode":"func validateUniquePackageNames(channel *kops.Addons) error {\n    seen := map[string]bool{}\n    for _, p := range channel.Spec.Packages {\n        if seen[p.Name] {\n            return fmt.Errorf(\"duplicate package %q in channel\", p.Name)\n        }\n        seen[p.Name] = true\n    }\n    return nil\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep each package name unique in channel YAML","Avoid merging channel files without deduplication","Prefer the official kops channel over hand edits"],"tags":["kops","channel","addons","duplicate-package"],"backgroundTag":"duplicate-package-in-channel","analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T12:17:11.808Z"}