kubernetes/kops · error

error fetching addons: %v

Error message

error fetching addons: %v

What it means

Run() lists the cluster's addons through the addons client (addonsClient.List). Any error from the backing addons channel/store — unreadable addons manifest, network failure fetching the addons channel, bad state-store permissions — is wrapped as this error. Addons are mandatory inputs to the loader, so Run aborts.

Source

Thrown at upup/pkg/fi/cloudup/apply_cluster.go:336

	keyStore, err := c.Clientset.KeyStore(cluster)
	if err != nil {
		return nil, err
	}

	sshCredentialStore, err := c.Clientset.SSHCredentialStore(cluster)
	if err != nil {
		return nil, err
	}

	secretStore, err := c.Clientset.SecretStore(cluster)
	if err != nil {
		return nil, err
	}

	addonsClient := c.Clientset.AddonsFor(cluster)
	addons, err := addonsClient.List(ctx)
	if err != nil {
		return nil, fmt.Errorf("error fetching addons: %v", err)
	}

	// Normalize k8s version
	versionWithoutV := strings.TrimSpace(cluster.Spec.KubernetesVersion)
	versionWithoutV = strings.TrimPrefix(versionWithoutV, "v")
	if cluster.Spec.KubernetesVersion != versionWithoutV {
		klog.Warningf("Normalizing kubernetes version: %q -> %q", cluster.Spec.KubernetesVersion, versionWithoutV)
		cluster.Spec.KubernetesVersion = versionWithoutV
	}

	// check if we should recommend turning off anonymousAuth
	{
		// we do a check here because setting modifying the kubelet object messes with the output
		warn := false
		if cluster.Spec.Kubelet == nil {
			warn = true
		} else if cluster.Spec.Kubelet.AnonymousAuth == nil {
			warn = true

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Retry after checking network access and cloud credentials for the state store / addons channel location.
  2. Restore or fix the addons object in the state store (re-upload kops addons from a matching kops release if it was corrupted).
  3. If a custom addons location is set in the cluster spec, verify the URL/path is correct and reachable.

Example fix

// before (unreachable custom channel)
aws s3 cp addons.yaml s3://state-bucket/...  # failed mid-sync
// after
aws s3 cp addons.yaml s3://state-bucket/<prefix>/addons/addons.yaml && kops update cluster ... --yes
Defensive patterns

Strategy: retry

Validate before calling

addonsClient := clientset.AddonsFor(cluster)
if _, err := addonsClient.List(ctx); err != nil {
    return fmt.Errorf("preflight: addons unreachable: %w", err)
}

Try / catch

addons, err := addonsClient.List(ctx)
if err != nil {
    if retriable(err) && attempt < maxAttempts {
        time.Sleep(backoff); continue
    }
    return fmt.Errorf("error fetching addons: %w", err)
}

Prevention

When it happens

Trigger: addonsClient.List(ctx) returns an error: the addons object at the addons location cannot be read (missing addons channel, inaccessible state store, invalid addons manifest YAML, network/permission failure).

Common situations: State store bucket permissions changed; custom addons channel URL unreachable; corrupted or truncated addons object after an interrupted sync; offline CI runner without network access to the addons channel.

Related errors


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