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
- List addresses with `gcloud compute addresses list --filter="address=<ip>" --project=<project>` and identify the duplicates.
- Delete the stale/duplicate address resource: `gcloud compute addresses delete <name> --region=<region>` (keep the one you intend kops to manage).
- If duplicates are in different subnets and both are intentional, set the subnet field for the task/spec so the subnet filter disambiguates.
- 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
- Before apply, run `gcloud compute addresses list --filter="address=<ip>"` and delete stale duplicates.
- Let kops manage all static IPs in the project; avoid hand-creating addresses in the console.
- Use distinct subnets/IPs per address task, or set the subnet field so lookups disambiguate.
- Clean up address resources from aborted kops runs instead of re-creating them manually.
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
- error listing IP Addresses: %v
- expected exactly one subnet with GCE IP Aliases
- address not found %q: %v
- error creating Router: %w
- error waiting for router creation: %w
AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05).
Data as JSON: /api/errors/7c5e1b089a5d9191.
Report an issue: GitHub.