kubernetes/kops · error

error finding Address %q: %v

Error message

error finding Address %q: %v

What it means

When the spec's IPAddress reference is set but has no concrete IP value, RenderGCE calls e.IPAddress.find() to look up the Address task in GCE. Any lookup error is wrapped as 'error finding Address %q: %v'. This is a failed read against the Compute Addresses API during apply.

Source

Thrown at upup/pkg/fi/cloudup/gcetasks/forwardingrule.go:190

	}

	if e.TargetPool != nil {
		o.Target = e.TargetPool.URL(t.Cloud)
	}

	if e.BackendService != nil {
		if o.Target != "" {
			return fmt.Errorf("cannot specify both %q and %q for forwarding rule target.", o.Target, e.BackendService)
		}
		o.BackendService = e.BackendService.URL(t.Cloud)
	}

	if e.IPAddress != nil {
		o.IPAddress = fi.ValueOf(e.IPAddress.IPAddress)
		if o.IPAddress == "" {
			addr, err := e.IPAddress.find(t.Cloud)
			if err != nil {
				return fmt.Errorf("error finding Address %q: %v", e.IPAddress, err)
			}
			if addr == nil {
				return fmt.Errorf("Address %q was not found", e.IPAddress)
			}

			o.IPAddress = fi.ValueOf(addr.IPAddress)
			if o.IPAddress == "" {
				return fmt.Errorf("Address had no IP: %v", e.IPAddress)
			}
		}
	}
	if o.IPAddress != "" && e.RuleIPAddress != nil {
		return fmt.Errorf("Specified both IP Address and rule-managed IP address: %v, %v", e.IPAddress, *e.RuleIPAddress)
	}
	if e.RuleIPAddress != nil {
		o.IPAddress = *e.RuleIPAddress
	}

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Inspect the wrapped %v cause; if not-found, create the static Address or correct its name.
  2. Verify the address exists in the same region as the forwarding rule.
  3. Set the IPAddress field explicitly in the spec to skip the lookup.
  4. Check IAM permissions for compute.addresses.get.
Defensive patterns

Strategy: try-catch

Validate before calling

// before applying, confirm the referenced address exists:
// gcloud compute addresses describe ADDR --region=R --project=P --format="value(address)"

Type guard

func addressRefResolvable(ref *Address, addrs []compute.Address) bool {
  if ref == nil { return true }
  for _, a := range addrs {
    if a.Name == fi.ValueOf(ref.Name) { return true }
  }
  return false
}

Try / catch

err := kopsUpdate()
if err != nil && strings.Contains(err.Error(), "error finding Address") {
  // address lookup failed: create the address or fix its name, then retry
  log.Printf("address lookup failed: %v", err)
}

Prevention

When it happens

Trigger: ForwardingRule spec references an Address task whose IPAddress field is empty and the find() call returns an error (API failure, wrong region, permission denied).

Common situations: Referencing a named static address that does not exist in the target region; cross-project address references; IAM missing compute.addresses.get; typo in the address name.

Related errors


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