{"record":{"id":"5ba5742944ab25bd","repo":"kubernetes/kops","slug":"error-listing-dns-resourcerecords-v","errorCode":null,"errorMessage":"error listing DNS ResourceRecords: %v","messagePattern":"error listing DNS ResourceRecords: (.+?)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/awstasks/dnsname.go","lineNumber":85,"sourceCode":"\tfindName = strings.TrimSuffix(findName, \".\")\n\n\tfindType := fi.ValueOf(e.ResourceType)\n\tif findType == \"\" {\n\t\treturn nil, nil\n\t}\n\n\trequest := &route53.ListResourceRecordSetsInput{\n\t\tHostedZoneId: e.Zone.ZoneID,\n\t\t// TODO: Start at correct name?\n\t}\n\n\tvar found *route53types.ResourceRecordSet\n\n\tpaginator := route53.NewListResourceRecordSetsPaginator(cloud.Route53(), request)\n\tfor paginator.HasMorePages() {\n\t\tpage, err := paginator.NextPage(ctx)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"error listing DNS ResourceRecords: %v\", err)\n\t\t}\n\t\tfor _, rr := range page.ResourceRecordSets {\n\t\t\tresourceType := rr.Type\n\t\t\tname := aws.ToString(rr.Name)\n\n\t\t\tklog.V(4).Infof(\"Found DNS resource %q %q\", resourceType, name)\n\n\t\t\tif findType != string(resourceType) {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tname = strings.TrimSuffix(name, \".\")\n\n\t\t\tif name == findName {\n\t\t\t\tfound = &rr\n\t\t\t\tbreak\n\t\t\t}\n\t\t}","sourceCodeStart":67,"sourceCodeEnd":103,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/awstasks/dnsname.go#L67-L103","documentation":"During DNSName.Find, kops paginates Route53 ListResourceRecordSets to locate the record matching the task's ResourceName/ResourceType (dnsname.go:85). If any NextPage call fails, the error is wrapped as 'error listing DNS ResourceRecords'. The Route53 SDK error (AuthFailure, NoSuchHostedZone, Throttling, network) is embedded after the %v.","triggerScenarios":"ListResourceRecordSets paginator NextPage returns an error: the hosted zone ID in e.Zone.ZoneID no longer exists (zone deleted/recreated), credentials lack route53:ListResourceRecordSets, network failure, or Route53 throttling.","commonSituations":"kops update after the hosted zone was deleted out-of-band; assumed-role credentials without Route53 read permissions; DNS zone migrated to another AWS account so the zone ID is stale; transient network drops during long pagination.","solutions":["Check the wrapped AWS error text for the specific cause","If NoSuchHostedZone: verify the hosted zone ID in the cluster spec still exists (aws route53 list-hosted-zones) and update it","If AccessDenied: add route53:ListResourceRecordSets to the credentials' IAM policy","If throttling/network: retry kops update; the failure is usually transient","Verify AWS_REGION / shared config points at the account where the zone lives"],"exampleFix":"// before: stale zone id in cluster spec\nspec.dnsZone: ZXXXXXXXXOLD\n// after\naws route53 list-hosted-zones --query 'HostedZones[?Name==`cluster.example.com.`]'\n# update the kops cluster spec with the current zone ID","handlingStrategy":"try-catch","validationCode":"// Verify the zone exists and is listable before the apply\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"github.com/aws/aws-sdk-go-v2/aws\"\n\t\"github.com/aws/aws-sdk-go-v2/service/route53\"\n)\n\nfunc zoneReadable(ctx context.Context, c *route53.Client, zoneID *string) error {\n\tif aws.ToString(zoneID) == \"\" {\n\t\treturn fmt.Errorf(\"hosted zone ID missing\")\n\t}\n\tif _, err := c.GetHostedZone(ctx, &route53.GetHostedZoneInput{Id: zoneID}); err != nil {\n\t\treturn fmt.Errorf(\"hosted zone %s not accessible: %w\", aws.ToString(zoneID), err)\n\t}\n\treturn nil\n}","typeGuard":null,"tryCatchPattern":"found, err := dnsName.Find(ctx, target)\nif err != nil {\n\tif strings.Contains(err.Error(), \"NoSuchHostedZone\") {\n\t\t// hosted zone deleted out-of-band: recreate zone or fix spec\n\t}\n\treturn fmt.Errorf(\"route53 listing failed: %w\", err)\n}","preventionTips":["Verify the hosted zone ID in the cluster spec still exists before kops update","Include route53:ListResourceRecordSets and route53:GetHostedZone in IAM policies","Watch for zones deleted/recreated by other tooling and re-sync zone IDs","Retry transient throttling/network errors; they are usually transient","Keep region/credential config consistent between kops and the zone's account"],"tags":["aws","route53","dns","kops","pagination"],"backgroundTag":"route53-hosted-zone-not-found","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"}