kubernetes/kops · error
error listing ELBs: %v
Error message
error listing ELBs: %v
What it means
Wraps AWS SDK errors from DescribeLoadBalancers (classic ELB) when kOps searches for an existing Classic Load Balancer by name during Find. The special 'LoadBalancerNotFound' code is treated as not-found (nil, nil); any other failure is wrapped in this error.
Source
Thrown at upup/pkg/fi/cloudup/awstasks/classic_load_balancer.go:75
func findLoadBalancerByLoadBalancerName(ctx context.Context, cloud awsup.AWSCloud, loadBalancerName string) (*elbtypes.LoadBalancerDescription, error) {
request := &elb.DescribeLoadBalancersInput{
LoadBalancerNames: []string{loadBalancerName},
}
found, err := describeLoadBalancers(ctx, cloud, request, func(lb elbtypes.LoadBalancerDescription) bool {
if aws.ToString(lb.LoadBalancerName) == loadBalancerName {
return true
}
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)View on GitHub (pinned to 4c8573c808)
Solutions
- Inspect the wrapped AWS error message for the root cause
- Grant elasticloadbalancing:DescribeLoadBalancers (and DescribeLoadBalancerAttributes/Tags) to the kOps IAM role
- Check the cluster region matches where the ELB exists
- Retry on throttling errors or add backoff between applies
Defensive patterns
Strategy: try-catch
Validate before calling
aws elb describe-load-balancers --load-balancer-names $LB_NAME 2>/dev/null || echo 'LB absent; creation path must be NLB'
Type guard
function isNotFound(err) { return err && err.code === 'LoadBalancerNotFound'; } Try / catch
try {
lb = await findLoadBalancerByLoadBalancerName(ctx, cloud, name);
} catch (err) {
if (awsup.AWSErrorCode(err) !== 'LoadBalancerNotFound') throw err; // surfaces wrapped ELB listing error
} Prevention
- Grant elasticloadbalancing:DescribeLoadBalancers to the kOps role
- Confirm the cluster region matches the ELB's region
- Refresh AWS credentials before long apply runs
When it happens
Trigger: The paginated elb DescribeLoadBalancers call fails with an error other than LoadBalancerNotFound: IAM permissions (elasticloadbalancing:DescribeLoadBalancers), throttling, invalid region/endpoint, or network failures.
Common situations: IAM policy scoped to only some ELB actions; AWS API throttling on large accounts with many ELBs; wrong region configuration in kOps cluster spec.
Related errors
- Found multiple ELBs with name %q
- error listing ELBs: %w
- error describing instance health: %v
- error listing resource record sets: %w
- describing instance for arn %q
AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05).
Data as JSON: /api/errors/038e616afb7719f9.
Report an issue: GitHub.