kubernetes/kops · error

error loading channel %q: %v

Error message

error loading channel %q: %v

What it means

After parsing an absolute location, buildMenu calls channels.LoadAddons to fetch and parse the addon manifest. Any failure (fetch error, invalid YAML, schema violation) is wrapped as 'error loading channel %q: %v'. This is the error surface for unusable or unreachable channel manifests.

Source

Thrown at channels/pkg/cmd/apply_channel.go:345

	return channelVersions, nil
}

func buildMenu(vfsContext *vfs.VFSContext, kubernetesVersion semver.Version, channelLocation string) (*channels.AddonMenu, error) {
	menu := channels.NewAddonMenu()

	location, err := url.Parse(channelLocation)
	if err != nil {
		return nil, fmt.Errorf("unable to parse argument %q as url", channelLocation)
	}
	if !location.IsAbs() {
		expanded := "https://raw.githubusercontent.com/kubernetes/kops/master/addons/" + channelLocation + "/addon.yaml"
		// Disallow the use of legacy addons from the "well-known" location starting Kubernetes 1.23:
		// https://raw.githubusercontent.com/kubernetes/kops/master/addons/<name>/addon.yaml
		return nil, fmt.Errorf("legacy addons are deprecated and unmaintained, use managed addons instead of %s", expanded)
	}
	o, err := channels.LoadAddons(vfsContext, channelLocation, location)
	if err != nil {
		return nil, fmt.Errorf("error loading channel %q: %v", location, err)
	}

	current, err := o.GetCurrent(kubernetesVersion)
	if err != nil {
		return nil, fmt.Errorf("error processing latest versions in %q: %v", location, err)
	}
	menu.MergeAddons(current)
	return menu, nil
}

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Confirm the addon.yaml URL is reachable and valid (curl/browser)
  2. Fix the URL path/branch/tag or the VFS path to the channel manifest
  3. Validate custom addon.yaml against the kOps addon schema
  4. Check proxy/TLS settings if the wrapped cause is a fetch error

Example fix

// before
kops apply channel https://raw.githubusercontent.com/kubernetes/kops/main/addons/dns-controller/addon.yaml  # 404, wrong branch
// after
kops apply channel https://raw.githubusercontent.com/kubernetes/kops/master/addons/dns-controller/addon.yaml
Defensive patterns

Strategy: fallback

Validate before calling

resp, err := http.Get(channelLocation)
if err != nil {
	return fmt.Errorf("channel manifest unreachable: %w", err)
}
if resp.StatusCode != http.StatusOK {
	return fmt.Errorf("channel manifest returned %d; check URL", resp.StatusCode)
}

Try / catch

o, err := channels.LoadAddons(vfsContext, channelLocation, location)
if err != nil {
	if fallback := os.Getenv("FALLBACK_CHANNEL_URL"); fallback != "" {
		return buildMenu(vfsContext, kubernetesVersion, fallback)
	}
	return nil, fmt.Errorf("error loading channel %q: %v", location, err)
}

Prevention

When it happens

Trigger: channels.LoadAddons fails during `kops apply channel <abs-url>`: 404 on addon.yaml, TLS/proxy failures, VFS path errors, or malformed/invalid manifest content.

Common situations: Typo in the addon.yaml URL, private repo requiring auth, corporate proxy blocking raw.githubusercontent.com, hand-authored addon.yaml failing schema validation.

Related errors


AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05). Data as JSON: /api/errors/2528f90fbc3fbb3d. Report an issue: GitHub.