kubernetes/kops · error

Address %q was not found

Error message

Address %q was not found

What it means

After a successful find() call, if it returns nil (address not present in GCE), RenderGCE aborts with 'Address %q was not found'. The forwarding rule cannot be rendered because its IP cannot be resolved; kOps refuses to silently allocate an unspecified IP.

Source

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

		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
	}

	if e.Network != nil {
		project := t.Cloud.Project()
		if e.Network.Project != nil {

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Create the static Address in GCE (gcloud compute addresses create ...) in the correct region, then re-apply.
  2. Correct the address name in the cluster spec to match the existing GCE Address.
  3. Provide an explicit IP address in the spec's IPAddress field instead of a name reference.
  4. Verify region/project configuration matches where the address was reserved.

Example fix

// before
ipAddress: { name: "old-lb-ip" }
// after
ipAddress: { name: "lb-ip", ipAddress: "34.10.20.30" }
Defensive patterns

Strategy: validation

Validate before calling

// before applying, assert the address exists and has an IP:
// test -n "$(gcloud compute addresses describe ADDR --region=R --format='value(address)')" || \
//   gcloud compute addresses create ADDR --region=R

Prevention

When it happens

Trigger: Spec references an Address task with an empty IPAddress, and find() returns nil because no Address with that name exists in the project/region at apply time.

Common situations: Address was deleted from GCE console or by another IaC tool; wrong region configured; address created after this apply was expected to run; name mismatch between spec and GCE.

Related errors


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