kubernetes/kops · error
listing NLBs: %v
Error message
listing NLBs: %v
What it means
The paginated DescribeLoadBalancers call failed while searching NLBs (describeNetworkLoadBalancers); the ELBV2 API request itself errored (permissions, wrong region, throttling) and the wrapped error carries the AWS detail.
Source
Thrown at upup/pkg/fi/cloudup/awstasks/network_load_balancer.go:148
if len(found) == 0 {
return nil, nil
}
if len(found) != 1 {
return nil, fmt.Errorf("Found multiple NLBs with DNSName %q", dnsName)
}
return &found[0], nil
}
func describeNetworkLoadBalancers(ctx context.Context, cloud awsup.AWSCloud, request *elbv2.DescribeLoadBalancersInput, filter func(elbv2types.LoadBalancer) bool) ([]elbv2types.LoadBalancer, error) {
var found []elbv2types.LoadBalancer
paginator := elbv2.NewDescribeLoadBalancersPaginator(cloud.ELBV2(), request)
for paginator.HasMorePages() {
page, err := paginator.NextPage(ctx)
if err != nil {
return nil, fmt.Errorf("listing NLBs: %v", err)
}
for _, lb := range page.LoadBalancers {
if filter(lb) {
found = append(found, lb)
}
}
}
return found, nil
}
func (e *NetworkLoadBalancer) getDNSName() *string {
return e.DNSName
}
func (e *NetworkLoadBalancer) getHostedZoneId() *string {
return e.HostedZoneId
}View on GitHub (pinned to 4c8573c808)
Solutions
- Grant elasticloadbalancing:DescribeLoadBalancers to the kops principal if UnauthorizedOperation
- Retry after backoff if the cause is ThrottlingException
- Check AWS health/status for the region if the API is failing broadly
Example fix
null
Defensive patterns
Strategy: retry
Try / catch
_, err := findNLBs(ctx)
var ae smithy.APIError
if errors.As(err, &ae) && (ae.ErrorCode() == "ThrottlingException" || ae.ErrorCode() == "RequestTimeout") {
time.Sleep(exponentialBackoff(attempt)); retry()
} Prevention
- Use exponential backoff for ELBv2 list operations
- Ensure IAM includes elasticloadbalancing:DescribeLoadBalancers
- Check AWS regional health before large applies
When it happens
Trigger: paginator.NextPage(ctx) returns an error — AWS throttling (ThrottlingException), invalid credentials, authorization failure, or network/API error — while paging through the account's NLBs.
Common situations: Accounts with many load balancers hitting pagination and throttling; IAM missing elasticloadbalancing:DescribeLoadBalancers; temporary AWS regional issues.
Related errors
- error describing instances: %v
- error listing AutoScaling LaunchTemplates: %v
- error listing ELBs: %w
- error listing IAM role policies: %v
- error listing IAM role policies for %v
AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05).
Data as JSON: /api/errors/3f01f03ba22566cf.
Report an issue: GitHub.