kubernetes/kops · error

error listing ELBs: %w

Error message

error listing ELBs: %w

What it means

Wraps any AWS SDK error from the paginated DescribeLoadBalancers call inside describeLoadBalancers, the helper used to enumerate classic ELBs. Any page failure aborts the whole listing with this wrapped error.

Source

Thrown at upup/pkg/fi/cloudup/awstasks/classic_load_balancer.go:95

	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)
			}
		}
	}
	return found, nil
}

func (e *ClassicLoadBalancer) Find(c *fi.CloudupContext) (*ClassicLoadBalancer, error) {
	ctx := c.Context()
	cloud := awsup.GetCloud(c)

	if e.LoadBalancerName == nil {
		return nil, nil
	}

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Read the wrapped AWS error code in the message for root cause
  2. Fix IAM permissions for elasticloadbalancing:DescribeLoadBalancers
  3. Refresh AWS credentials (AccessKeyID/SecretAccessKey session state)
  4. Retry after backoff if throttled

Example fix

// before: expired creds
export AWS_ACCESS_KEY_ID=old_expired_key
// after: refresh credentials
aws sts get-caller-identity  # verify before kops apply
Defensive patterns

Strategy: retry

Validate before calling

aws sts get-caller-identity && aws elb describe-load-balancers --query 'LoadBalancerDescriptions | length(@)'

Type guard

function isThrottling(err) { return ['Throttling','RequestLimitExceeded','ThrottlingException'].includes(err && err.code); }

Try / catch

try {
  return await describeLoadBalancers(ctx, cloud, req, filter);
} catch (err) {
  if (isThrottling(err)) return withBackoff(() => describeLoadBalancers(ctx, cloud, req, filter));
  throw err;
}

Prevention

When it happens

Trigger: Any page of the DescribeLoadBalancersPaginator fails: IAM authorization failure, throttling (Throttling/RequestLimitExceeded), invalid credentials, or network interruption mid-pagination.

Common situations: Accounts with many ELBs hitting pagination + throttling; expired/stale AWS credentials (InvalidClientTokenId); VPC endpoint or connectivity problems.

Related errors


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