kubernetes/kops · error
Found multiple ELBs with name %q
Error message
Found multiple ELBs with name %q
What it means
Thrown when the name-based ELB search returns more than one match: two or more classic load balancers in the region match the filter for the given load balancer name. Find requires a unique ELB and refuses to pick one arbitrarily.
Source
Thrown at upup/pkg/fi/cloudup/awstasks/classic_load_balancer.go:83
}
klog.Warningf("Got ELB with unexpected name: %q", aws.ToString(lb.LoadBalancerName))
return false
})
if err != nil {
if awsup.AWSErrorCode(err) == "LoadBalancerNotFound" {
return nil, nil
}
return nil, fmt.Errorf("error listing ELBs: %v", err)
}
if len(found) == 0 {
return nil, nil
}
if len(found) != 1 {
return nil, fmt.Errorf("Found multiple ELBs with name %q", loadBalancerName)
}
return &found[0], nil
}
func describeLoadBalancers(ctx context.Context, cloud awsup.AWSCloud, request *elb.DescribeLoadBalancersInput, filter func(elbtypes.LoadBalancerDescription) bool) ([]elbtypes.LoadBalancerDescription, error) {
var found []elbtypes.LoadBalancerDescription
paginator := elb.NewDescribeLoadBalancersPaginator(cloud.ELB(), request)
for paginator.HasMorePages() {
output, err := paginator.NextPage(ctx)
if err != nil {
return nil, fmt.Errorf("error listing ELBs: %w", err)
}
for _, lb := range output.LoadBalancerDescriptions {
if filter(lb) {
found = append(found, lb)
}View on GitHub (pinned to 4c8573c808)
Solutions
- Run aws elb describe-load-balancers and identify the duplicates
- Delete the stale/unused ELB (aws elb delete-load-balancer)
- Ensure cluster names are unique per region to avoid name collisions
- Clean up orphaned ELBs before re-running kops apply
Example fix
// before: two ELBs with same name pattern aws elb delete-load-balancer --load-balancer-name mycluster-api # stale one // after: only the correct ELB remains aws elb describe-load-balancers --query 'LoadBalancerDescriptions[].LoadBalancerName'
Defensive patterns
Strategy: validation
Validate before calling
aws elb describe-load-balancers --query "LoadBalancerDescriptions[?LoadBalancerName=='$LB_NAME'] | length(@)" # expect 1 before running kops apply
Try / catch
catch (err) {
if (String(err).startsWith('Found multiple ELBs with name')) {
// list and delete stale duplicates, then retry
}
throw err;
} Prevention
- Use unique cluster names per region
- Clean up orphaned ELBs from deleted clusters
- Keep one IaC tool as the ELB source of truth
When it happens
Trigger: Multiple classic ELBs share the same LoadBalancerName pattern being filtered (note ELB names are region-unique, so this usually means the filter matches tagged/name-prefixed duplicates) or stale/duplicate ELBs left from previous applies.
Common situations: Leftover ELBs from deleted clusters with the same cluster name; running two clusters with the same name in one region; manual duplicate creation.
Related errors
- error listing ELBs: %v
- error describing instance health: %v
- error deleting LoadBalancer %q: %v
- error listing elbs: %v
- error listing elb Tags: %v
AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05).
Data as JSON: /api/errors/0f83ce2255e56557.
Report an issue: GitHub.