{"record":{"id":"2105666f6d9cb599","repo":"kubernetes/kops","slug":"listing-elb-loadbalancers-w","errorCode":null,"errorMessage":"listing ELB LoadBalancers: %w","messagePattern":"listing ELB LoadBalancers: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/awsup/elbv2_loadbalancers.go","lineNumber":70,"sourceCode":"\t}\n\treturn \"\", false\n}\n\nfunc ListELBV2LoadBalancers(ctx context.Context, cloud AWSCloud) ([]*LoadBalancerInfo, error) {\n\t// TODO: Any way around this?\n\tklog.V(2).Infof(\"Listing all NLBs for ListELBV2LoadBalancers\")\n\n\trequest := &elbv2.DescribeLoadBalancersInput{}\n\t// ELBV2 DescribeTags has a limit of 20 names, so we set the page size here to 20 also\n\trequest.PageSize = aws.Int32(20)\n\n\tbyARN := make(map[string]*LoadBalancerInfo)\n\n\tpaginator := elbv2.NewDescribeLoadBalancersPaginator(cloud.ELBV2(), request)\n\tfor paginator.HasMorePages() {\n\t\tpage, err := paginator.NextPage(ctx)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"listing ELB LoadBalancers: %w\", err)\n\t\t}\n\t\tif len(page.LoadBalancers) == 0 {\n\t\t\tbreak\n\t\t}\n\n\t\ttagRequest := &elbv2.DescribeTagsInput{}\n\n\t\tfor _, elb := range page.LoadBalancers {\n\t\t\tarn := aws.ToString(elb.LoadBalancerArn)\n\t\t\tbyARN[arn] = &LoadBalancerInfo{LoadBalancer: elb, arn: arn}\n\n\t\t\t// TODO: Any way to filter by cluster here?\n\n\t\t\ttagRequest.ResourceArns = append(tagRequest.ResourceArns, aws.ToString(elb.LoadBalancerArn))\n\t\t}\n\n\t\ttagResponse, err := cloud.ELBV2().DescribeTags(ctx, tagRequest)\n\t\tif err != nil {","sourceCodeStart":52,"sourceCodeEnd":88,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/awsup/elbv2_loadbalancers.go#L52-L88","documentation":"ListELBV2LoadBalancers pages through DescribeLoadBalancers via the AWS SDK paginator. Any AWS API error during pagination (auth, throttling, network, invalid region/credentials) is wrapped with this message. The wrap preserves the underlying SDK error via %w for errors.Is/As inspection.","triggerScenarios":"ELBV2 DescribeLoadBalancers API call fails: expired/missing AWS credentials, throttling (ThrottlingException), network timeouts, wrong region endpoint, or API disabled in the partition.","commonSituations":"Running kOps with stale AWS session tokens; IAM user lacking elasticloadbalancing:DescribeLoadBalancers permission; rate limiting during large-scale reconciles; transient network outages in CI.","solutions":["Read the wrapped cause (%w) with errors.Is/As to identify the actual SDK error (auth, throttle, network).","Refresh AWS credentials (aws sso login / new session token) and verify the region configuration.","Ensure IAM policy grants elasticloadbalancing:DescribeLoadBalancers and elasticloadbalancing:DescribeTags.","Retry on throttling errors with backoff; reduce concurrent listing frequency."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// preflight: verify credentials and region\nsess := session.Must(session.NewSession())\n_, err := sts.New(sess).GetCallerIdentity(&sts.GetCallerIdentityInput{})","typeGuard":null,"tryCatchPattern":"lbs, err := cloud.ListELBV2LoadBalancers()\nvar awsErr awserr.Error\nif errors.As(err, &awsErr) {\n\tif awsErr.Code() == \"Throttling\" {\n\t\t// retry with backoff\n\t}\n}","preventionTips":["Refresh AWS credentials before long CI runs","Ensure IAM grants elasticloadbalancing:DescribeLoadBalancers","Configure SDK retryer with increased max attempts for throttling","Confirm region in kops cluster spec matches the AWS region"],"tags":["aws","elbv2","api-error","list"],"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"}