{"record":{"id":"722869b91b8a542c","repo":"kubernetes/kops","slug":"error-listing-dns-resource-records-for-q-v","errorCode":null,"errorMessage":"error listing DNS resource records for %q: %v","messagePattern":"error listing DNS resource records for %q: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/dns.go","lineNumber":165,"sourceCode":"\tzone, err := findZone(cluster, cloud)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif zone == nil {\n\t\treturn nil\n\t}\n\n\trrs, ok := zone.ResourceRecordSets()\n\tif !ok {\n\t\treturn fmt.Errorf(\"error getting DNS resource records for %q\", zone.Name())\n\t}\n\n\trecordsMap := make(map[string]dnsprovider.ResourceRecordSet)\n\t// TODO: We should change the filter to be a suffix match instead\n\t// records, err := rrs.List(\"\", \"\")\n\trecords, err := rrs.List()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error listing DNS resource records for %q: %v\", zone.Name(), err)\n\t}\n\n\tfor _, record := range records {\n\t\tname := dns.EnsureDotSuffix(record.Name())\n\t\tkey := string(record.Type()) + \"::\" + name\n\t\trecordsMap[key] = record\n\t}\n\n\tchangeset := rrs.StartChangeset()\n\t// TODO: Add ChangeSet.IsEmpty() method\n\tvar created []recordKey\n\n\tfor _, recordKey := range recordKeys {\n\t\trecordKey.hostname = dns.EnsureDotSuffix(recordKey.hostname)\n\t\tfoundAddress := false\n\t\t{\n\t\t\tdnsRecord := recordsMap[string(recordKey.rrsType)+\"::\"+recordKey.hostname]\n\t\t\tif dnsRecord != nil {","sourceCodeStart":147,"sourceCodeEnd":183,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/dns.go#L147-L183","documentation":"precreateDNS calls rrs.List() to fetch all resource record sets in the zone so it can detect which kOps records already exist. If the provider API call fails, the error is wrapped as 'error listing DNS resource records'. Cluster creation aborts because existing records cannot be safely compared/merged.","triggerScenarios":"rrs.List() returns an error while running create/update cluster: DNS provider API outage, expired/invalid credentials, throttling, or a provider SDK failure during DNS pre-creation of internal names like api.<cluster> and nodes.<cluster>.","commonSituations":"AWS credentials lacking route53:ListResourceRecordSets permission; Route53 API throttling (rate limiting) on large zones; transient network failure to the DNS provider API; Cloud DNS API not enabled on the GCP project.","solutions":["Retry the kops command — many failures are transient API/network errors","Verify IAM/API permissions: route53:ListResourceRecordSets (AWS) or DNS read scope (GCP)","Check DNS provider service health and rate limits; reduce concurrent runs against the same zone","Confirm API enabled for the project/subscription (e.g. dns.googleapis.com)"],"exampleFix":"// before\n# IAM policy missing route53 read permissions -> List() fails\n// after\n# attach required policy\n{\n  \"Effect\": \"Allow\",\n  \"Action\": [\"route53:ListResourceRecordSets\", \"route53:ChangeResourceRecordSets\", \"route53:GetChange\"],\n  \"Resource\": \"*\"\n}","handlingStrategy":"retry","validationCode":"// verify credentials/API access beforehand\naws route53 test-credentials: `aws route53 list-hosted-zones` must succeed with the same env/credentials kOps uses","typeGuard":null,"tryCatchPattern":"records, err := rrs.List()\nif err != nil {\n    return retry.Do(3, 5*time.Second, func() error {\n        _, err = rrs.List()\n        return err\n    })\n}","preventionTips":["Pre-check IAM permissions (route53:ListResourceRecordSets / Cloud DNS read)","Watch for API rate limits when running kops against large shared zones","Confirm provider APIs are enabled on the project/subscription","Retry transient failures before assuming misconfiguration"],"tags":["dns","api-error","permissions"],"backgroundTag":"dns-api-list-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"}