{"record":{"id":"a34d54f0b8e2862d","repo":"kubernetes/kops","slug":"error-describing-targetgroup-s-w","errorCode":null,"errorMessage":"error describing targetgroup %s: %w","messagePattern":"error describing targetgroup (.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/awstasks/targetgroup.go","lineNumber":185,"sourceCode":"\treturn latest, nil\n}\n\nfunc (e *TargetGroup) findTargetGroupByARN(ctx context.Context, cloud awsup.AWSCloud) (*awsup.TargetGroupInfo, error) {\n\trequest := &elbv2.DescribeTargetGroupsInput{}\n\trequest.TargetGroupArns = []string{aws.ToString(e.ARN)}\n\n\tvar targetGroups []elbv2types.TargetGroup\n\tpaginator := elbv2.NewDescribeTargetGroupsPaginator(cloud.ELBV2(), request)\n\tfor paginator.HasMorePages() {\n\t\tpage, err := paginator.NextPage(ctx)\n\t\tif err != nil {\n\t\t\tvar nfe *elbv2types.TargetGroupNotFoundException\n\t\t\tif errors.As(err, &nfe) {\n\t\t\t\tif !fi.ValueOf(e.Shared) {\n\t\t\t\t\treturn nil, nil\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn nil, fmt.Errorf(\"error describing targetgroup %s: %w\", *e.ARN, err)\n\t\t}\n\t\ttargetGroups = append(targetGroups, page.TargetGroups...)\n\t}\n\tif len(targetGroups) > 1 {\n\t\treturn nil, fmt.Errorf(\"found %d TargetGroups with ID %q, expected 1\", len(targetGroups), fi.ValueOf(e.Name))\n\t} else if len(targetGroups) == 0 {\n\t\treturn nil, nil\n\t}\n\ttg := targetGroups[0]\n\n\ttagResponse, err := cloud.ELBV2().DescribeTags(ctx, &elbv2.DescribeTagsInput{\n\t\tResourceArns: []string{aws.ToString(tg.TargetGroupArn)},\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tinfo := &awsup.TargetGroupInfo{","sourceCodeStart":167,"sourceCodeEnd":203,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/awstasks/targetgroup.go#L167-L203","documentation":"DescribeTargetGroups errored while fetching the target group by ARN; TargetGroupNotFoundException is handled separately (returning nil for non-shared groups), so this wrapped error is another AWS failure (permissions, throttling).","triggerScenarios":"Thrown at upup/pkg/fi/cloudup/awstasks/targetgroup.go:185 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check elasticloadbalancing:DescribeTargetGroups permissions","Retry the apply for transient API errors"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T12:17:11.808Z"}