kubernetes/kops · error

error finding address for %v: %v

Error message

error finding address for %v: %v

What it means

When generating node bootstrap configuration, kubeEnv iterates over tasks implementing HasAddress and calls FindAddresses to build the well-known-addresses map. If a task's address lookup returns an error, it is wrapped as "error finding address for <task>: <cause>" and nodeup config generation fails.

Source

Thrown at pkg/model/bootstrapscript.go:87

	nodeupConfig fi.CloudupTaskDependentResource
	// nodeupScript contains the nodeup bootstrap script, for use with Karpenter.
	nodeupScript fi.CloudupTaskDependentResource
}

var (
	_ fi.CloudupTask            = &BootstrapScript{}
	_ fi.HasName                = &BootstrapScript{}
	_ fi.CloudupHasDependencies = &BootstrapScript{}
)

// kubeEnv returns the boot config for the instance group
func (b *BootstrapScript) kubeEnv(cluster *kops.Cluster, ig *kops.InstanceGroup, c *fi.CloudupContext) (*nodeup.BootConfig, error) {
	wellKnownAddresses := make(WellKnownAddresses)

	for _, hasAddress := range b.hasAddressTasks {
		addresses, err := hasAddress.FindAddresses(c)
		if err != nil {
			return nil, fmt.Errorf("error finding address for %v: %v", hasAddress, err)
		}
		if len(addresses) == 0 {
			// Such tasks won't have an address in dry-run mode, until the resource is created
			klog.V(2).Infof("Task did not have an address: %v", hasAddress)
			continue
		}

		klog.V(8).Infof("Resolved alternateNames %q for %q", addresses, hasAddress)

		for _, wellKnownService := range hasAddress.GetWellKnownServices() {
			wellKnownAddresses[wellKnownService] = append(wellKnownAddresses[wellKnownService], addresses...)
		}
	}

	for k := range wellKnownAddresses {
		sort.Strings(wellKnownAddresses[k])
	}

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Read the wrapped cause (%v) to identify the underlying task and cloud error, then fix that first.
  2. Verify cloud credentials and IAM permissions can describe the relevant resources (e.g. ELB/API LB).
  3. Re-run `kops update cluster` after transient cloud API failures; delete stale/recreated resources that no longer match cluster state.
Defensive patterns

Strategy: retry

Validate before calling

if err := checkCloudCredentials(ctx); err != nil {
  return fmt.Errorf("cloud credentials/permissions insufficient before update: %w", err)
}

Try / catch

if err := kopsUpdate(); err != nil {
  if strings.Contains(err.Error(), "error finding address for") {
    // transient cloud API failure: log cause, back off and retry
    klog.Warningf("address lookup failed: %v; retrying", err)
    time.Sleep(backoff)
    return kopsUpdate()
  }
  return err
}

Prevention

When it happens

Trigger: Running `kops update cluster` where an address-providing task (e.g. load balancer, bastion, or API server task) fails FindAddresses due to an underlying cloud/API error or missing cloud state.

Common situations: Cloud API outages or throttling during cluster creation; credentials lacking permission to describe load balancers; partial cluster state where a referenced resource does not exist in the cloud account.

Related errors


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