kubernetes/kops · error

error listing elbs: %v

Error message

error listing elbs: %v

What it means

DescribeELBs fails while paginating ELB DescribeLoadBalancers; kOps wraps the AWS error as 'error listing elbs'. This is a read/list failure, not a delete failure — listing is used to discover ELBs belonging to the cluster by tags.

Source

Thrown at pkg/resources/aws/aws.go:1579

func DescribeELBs(cloud fi.Cloud) ([]elbtypes.LoadBalancerDescription, map[string][]elbtypes.Tag, error) {
	ctx := context.TODO()
	c := cloud.(awsup.AWSCloud)
	tags := c.Tags()

	klog.V(2).Infof("Listing all ELBs")

	request := &elb.DescribeLoadBalancersInput{}
	// ELB DescribeTags has a limit of 20 names, so we set the page size here to 20 also
	request.PageSize = aws.Int32(20)

	var elbs []elbtypes.LoadBalancerDescription
	elbTags := make(map[string][]elbtypes.Tag)

	paginator := elb.NewDescribeLoadBalancersPaginator(c.ELB(), request)
	for paginator.HasMorePages() {
		page, err := paginator.NextPage(ctx)
		if err != nil {
			return nil, nil, fmt.Errorf("error listing elbs: %v", err)
		}
		if len(page.LoadBalancerDescriptions) == 0 {
			continue
		}
		tagRequest := &elb.DescribeTagsInput{}

		nameToELB := make(map[string]elbtypes.LoadBalancerDescription)
		for _, elb := range page.LoadBalancerDescriptions {
			name := aws.ToString(elb.LoadBalancerName)
			nameToELB[name] = elb

			tagRequest.LoadBalancerNames = append(tagRequest.LoadBalancerNames, aws.ToString(elb.LoadBalancerName))
		}

		tagResponse, err := c.ELB().DescribeTags(ctx, tagRequest)
		if err != nil {
			// An ELB may be deleted between DescribeLoadBalancers and DescribeTags;
			// in that case the batched call fails, so fall back to per-ELB lookups.

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Retry the listing operation; throttling and transient failures typically clear quickly.
  2. Grant IAM permission elasticloadbalancing:DescribeLoadBalancers (and DescribeTags) to the credentials.
  3. Add pagination/backoff or run during off-peak if rate limits are being hit in large accounts.
  4. Check network/proxy connectivity to the ELB regional endpoint.
  5. Check the wrapped AWS error code to distinguish auth vs throttling vs networking.
Defensive patterns

Strategy: retry

Validate before calling

// Pre-flight IAM check via dry listing
_, err := c.ELB().DescribeLoadBalancers(ctx, &elb.DescribeLoadBalancersInput{PageSize: aws.Int32(1)})
if err != nil { /* fail fast: DescribeLoadBalancers not permitted or API unreachable */ }

Try / catch

if err != nil {
    if awsup.AWSErrorCode(err) == "ThrottlingException" {
        time.Sleep(2 * time.Second); return DescribeELBs(ctx, cloud, vpcID) // retry
    }
    return nil, nil, err
}

Prevention

When it happens

Trigger: DescribeLoadBalancers pagination returns an error: AccessDenied, ThrottlingException, request-limit-exceeded, or network/SDK failure during ListELBs cluster inventory.

Common situations: Read-only credentials missing elasticloadbalancing:DescribeLoadBalancers; large accounts hitting API rate limits; transient AWS outages during 'kops delete cluster --dry-run' or toolbox dump.

Related errors


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