{"record":{"id":"01a2cd709093ee98","repo":"kubernetes/kops","slug":"error-listing-elbs-w","errorCode":null,"errorMessage":"error listing ELBs: %w","messagePattern":"error listing ELBs: %w","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/awstasks/classic_load_balancer.go","lineNumber":95,"sourceCode":"\n\tif len(found) == 0 {\n\t\treturn nil, nil\n\t}\n\n\tif len(found) != 1 {\n\t\treturn nil, fmt.Errorf(\"Found multiple ELBs with name %q\", loadBalancerName)\n\t}\n\n\treturn &found[0], nil\n}\n\nfunc describeLoadBalancers(ctx context.Context, cloud awsup.AWSCloud, request *elb.DescribeLoadBalancersInput, filter func(elbtypes.LoadBalancerDescription) bool) ([]elbtypes.LoadBalancerDescription, error) {\n\tvar found []elbtypes.LoadBalancerDescription\n\tpaginator := elb.NewDescribeLoadBalancersPaginator(cloud.ELB(), request)\n\tfor paginator.HasMorePages() {\n\t\toutput, err := paginator.NextPage(ctx)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"error listing ELBs: %w\", err)\n\t\t}\n\n\t\tfor _, lb := range output.LoadBalancerDescriptions {\n\t\t\tif filter(lb) {\n\t\t\t\tfound = append(found, lb)\n\t\t\t}\n\t\t}\n\t}\n\treturn found, nil\n}\n\nfunc (e *ClassicLoadBalancer) Find(c *fi.CloudupContext) (*ClassicLoadBalancer, error) {\n\tctx := c.Context()\n\tcloud := awsup.GetCloud(c)\n\n\tif e.LoadBalancerName == nil {\n\t\treturn nil, nil\n\t}","sourceCodeStart":77,"sourceCodeEnd":113,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/awstasks/classic_load_balancer.go#L77-L113","documentation":"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.","triggerScenarios":"Any page of the DescribeLoadBalancersPaginator fails: IAM authorization failure, throttling (Throttling/RequestLimitExceeded), invalid credentials, or network interruption mid-pagination.","commonSituations":"Accounts with many ELBs hitting pagination + throttling; expired/stale AWS credentials (InvalidClientTokenId); VPC endpoint or connectivity problems.","solutions":["Read the wrapped AWS error code in the message for root cause","Fix IAM permissions for elasticloadbalancing:DescribeLoadBalancers","Refresh AWS credentials (AccessKeyID/SecretAccessKey session state)","Retry after backoff if throttled"],"exampleFix":"// before: expired creds\nexport AWS_ACCESS_KEY_ID=old_expired_key\n// after: refresh credentials\naws sts get-caller-identity  # verify before kops apply","handlingStrategy":"retry","validationCode":"aws sts get-caller-identity && aws elb describe-load-balancers --query 'LoadBalancerDescriptions | length(@)'","typeGuard":"function isThrottling(err) { return ['Throttling','RequestLimitExceeded','ThrottlingException'].includes(err && err.code); }","tryCatchPattern":"try {\n  return await describeLoadBalancers(ctx, cloud, req, filter);\n} catch (err) {\n  if (isThrottling(err)) return withBackoff(() => describeLoadBalancers(ctx, cloud, req, filter));\n  throw err;\n}","preventionTips":["Add retry/backoff around ELB listing on large accounts","Rotate credentials before they expire (InvalidClientTokenId)","Verify network access/region endpoint for the ELB API"],"tags":["aws","elb","pagination","api-error"],"backgroundTag":"aws-api-call-failed","analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T07:17:12.445Z"}