kubernetes/kops · error

found multiple Addresses matching %q

Error message

found multiple Addresses matching %q

What it means

After filtering GCE addresses by the target IP, findAddressByIP found more than one static address matching the same IP within the project/region (subnet filtering was optional). Because a static IP resource must map to exactly one Address task, kOps refuses to guess and aborts. This is an ambiguous-state protection, not an API failure.

Source

Thrown at upup/pkg/fi/cloudup/gcetasks/address.go:89

		return nil, fmt.Errorf("error listing IP Addresses: %v", err)
	}

	var matches []*compute.Address
	for _, addr := range addrs {
		if subnet != "" && addr.Subnetwork != subnet {
			continue
		}
		if addr.Address == ip {
			matches = append(matches, addr)
		}
	}

	if len(matches) == 0 {
		return nil, nil
	}

	if len(matches) > 1 {
		return nil, fmt.Errorf("found multiple Addresses matching %q", ip)
	}

	addr := matches[0]

	actual := &Address{}
	actual.IPAddress = &addr.Address
	actual.IPAddressType = &addr.AddressType
	actual.Purpose = &addr.Purpose
	actual.Name = &addr.Name
	if addr.Subnetwork != "" {
		actual.Subnetwork = &Subnet{
			Name: new(lastComponent(addr.Subnetwork)),
		}
	}

	return actual, nil
}

View on GitHub (pinned to 4c8573c808)

Solutions

  1. List addresses with `gcloud compute addresses list --filter="address=<ip>" --project=<project>` and identify the duplicates.
  2. Delete the stale/duplicate address resource: `gcloud compute addresses delete <name> --region=<region>` (keep the one you intend kops to manage).
  3. If duplicates are in different subnets and both are intentional, set the subnet field for the task/spec so the subnet filter disambiguates.
  4. Re-run `kops update cluster` so Find resolves a single address.
Defensive patterns

Strategy: validation

Validate before calling

out, _ := exec.Command("gcloud", "compute", "addresses", "list",
    "--project", project, "--filter", "address="+ip, "--format", "value(name)").Output()
names := strings.Fields(string(out))
if len(names) > 1 {
    return fmt.Errorf("duplicate GCE addresses for IP %s: %v", ip, names)
}

Prevention

When it happens

Trigger: findAddressByIP (called by Find) collects addresses from ListWithFilter, applies optional subnet filtering, and matches on the IP; len(matches) > 1 means two or more GCE Address resources (possibly in different subnets) resolve to the same external/internal IP in the region.

Common situations: Duplicate address resources left behind by earlier failed kops runs, addresses created manually in GCP console colliding with kops-managed ones, or regional addresses in different subnets holding the same reserved IP name set.

Related errors


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