{"record":{"id":"afae6f3795f167d4","repo":"kubernetes/kops","slug":"found-no-packages-in-channel-for-name-q","errorCode":null,"errorMessage":"found no packages in channel for name=%q","messagePattern":"found no packages in channel for name=%q","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/apis/kops/channel.go","lineNumber":429,"sourceCode":"\t\t\t}\n\n\t\t\tversionRange, err := semver.ParseRange(pkg.KopsVersion)\n\t\t\tif err != nil {\n\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":411,"sourceCodeEnd":441,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/pkg/apis/kops/channel.go#L411-L441","documentation":"GetPackageVersion searches the channel's package list for entries matching the requested name and whose version/kopsVersion constraints match. This error means after filtering, zero packages matched — the requested addon/package name does not exist in the channel (or all candidates were excluded by version-range mismatches).","triggerScenarios":"CreateAddons -> GetPackageVersion(name) where no channel package has a matching manifest/name, or every candidate was skipped because its kopsVersion range failed to parse (warning + continue) or its version constraints excluded the current kOps/Kubernetes version.","commonSituations":"Typo in addon name when calling GetPackageVersion/CreateAddons; custom channel missing the addon manifest; channel from an older kOps release lacking newly added packages; all packages filtered out because the channel's kopsVersion ranges don't cover a custom-built kOps version.","solutions":["Verify the exact package/addon name against the channel file's package list (names are case-sensitive).","Dump the channel (kops get or curl the channel URL) and confirm the package entry exists with a matching manifestSelector/name.","Check that the channel is current for your kOps version — upgrade the channel or use the channel matching your kOps release.","If using a custom kOps build, ensure its version is valid semver so kopsVersion range filters don't silently drop every package (see also 'parsing kops version' error)."],"exampleFix":"// before\nGetPackageVersion(channel, \"networking.calic0\")\n// after\nGetPackageVersion(channel, \"networking.calico\")","handlingStrategy":"fallback","validationCode":"found := false\nfor _, pkg := range channel.Spec.Packages {\n    if pkg.Name == name { found = true; break }\n}\nif !found {\n    return fmt.Errorf(\"channel %s has no package named %s\", channelName, name)\n}","typeGuard":null,"tryCatchPattern":"v, err := GetPackageVersion(channel, name)\nif err != nil && strings.Contains(err.Error(), \"found no packages\") {\n    // fall back to a default/bundled manifest or skip the addon\n    klog.Warningf(\"package %q absent from channel; skipping\", name)\n    return nil, nil\n}","preventionTips":["Verify addon/package names against the channel file (exact, case-sensitive match)","Keep the channel version in sync with your kOps release","List available packages from the channel before requesting one","When using custom kOps builds, ensure the version is parseable so kopsVersion filters do not silently drop all candidates"],"tags":["kops","channel","addons","not-found"],"backgroundTag":"package-not-found","analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T07:17:12.445Z"}