{"record":{"id":"357b9217579e4d70","repo":"kubernetes/kops","slug":"error-listing-resource-record-sets-w","errorCode":null,"errorMessage":"error listing resource record sets: %w","messagePattern":"error listing resource record sets: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"dnsprovider/pkg/dnsprovider/providers/aws/route53/rrsets.go","lineNumber":47,"sourceCode":"\n// Compile time check for interface adherence\nvar _ dnsprovider.ResourceRecordSets = ResourceRecordSets{}\n\ntype ResourceRecordSets struct {\n\tzone *Zone\n}\n\nfunc (rrsets ResourceRecordSets) List() ([]dnsprovider.ResourceRecordSet, error) {\n\tinput := &route53.ListResourceRecordSetsInput{\n\t\tHostedZoneId: rrsets.zone.impl.Id,\n\t}\n\n\tvar list []dnsprovider.ResourceRecordSet\n\tpaginator := route53.NewListResourceRecordSetsPaginator(rrsets.zone.zones.interface_.service, input)\n\tfor paginator.HasMorePages() {\n\t\tpage, err := paginator.NextPage(context.TODO())\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"error listing resource record sets: %w\", err)\n\t\t}\n\t\tfor _, rrset := range page.ResourceRecordSets {\n\t\t\tlist = append(list, &ResourceRecordSet{&rrset, &rrsets})\n\t\t}\n\t}\n\treturn list, nil\n}\n\nfunc (rrsets ResourceRecordSets) Get(name string) ([]dnsprovider.ResourceRecordSet, error) {\n\t// This list implementation is very similar to the one implemented in\n\t// the List() method above, but it restricts the retrieved list to\n\t// the records whose name match the given `name`.\n\tinput := &route53.ListResourceRecordSetsInput{\n\t\tHostedZoneId:    rrsets.zone.impl.Id,\n\t\tStartRecordName: aws.String(name),\n\t}\n\n\tvar list []dnsprovider.ResourceRecordSet","sourceCodeStart":29,"sourceCodeEnd":65,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/dnsprovider/pkg/dnsprovider/providers/aws/route53/rrsets.go#L29-L65","documentation":"Zone rrset List() pages through Route53 ListResourceRecordSets for the hosted zone. Any paginator NextPage failure (API error, throttling, auth, networking) is wrapped with this message and returned to the caller.","triggerScenarios":"Calling List() on a Route53 zone when ListResourceRecordSetsPages fails: AccessDenied, Throttling, invalid hosted zone ID, or network failure.","commonSituations":"IAM policy lacking route53:ListResourceRecordSets; zone ID pointing to a deleted zone (NoSuchHostedZone); Route53 API throttling; expired credentials.","solutions":["Check the wrapped error type; grant route53:ListResourceRecordSets on the zone if AccessDenied.","Verify the hosted zone ID still exists (`aws route53 get-hosted-zone --id ...`).","Retry on throttling — the SDK's standard retryer handles transient 5xx/throttle; reduce call rate if persistent.","Refresh expired/invalid AWS credentials."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// pre-flight IAM check\nout, err := exec.Command(\"aws\", \"route53\", \"list-hosted-zones\").Output()\nif err != nil {\n    return fmt.Errorf(\"route53 read access missing: %w\", err)\n}\n_ = out","typeGuard":null,"tryCatchPattern":"rrsets, err := zone.RecordSets().List()\nif err != nil {\n    var opErr *smithy.OperationError\n    if errors.As(err, &opErr) && strings.Contains(err.Error(), \"Throttling\") {\n        time.Sleep(backoff); // retry\n    }\n    if strings.Contains(err.Error(), \"AccessDenied\") {\n        return fmt.Errorf(\"grant route53:ListResourceRecordSets: %w\", err)\n    }\n}","preventionTips":["Grant route53:ListResourceRecordSets (and ListHostedZones) to the caller.","Use exponential backoff for Throttling errors.","Verify hosted zone IDs before querying."],"tags":["aws","route53","api-error"],"backgroundTag":"aws-api-access-denied","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"}