{"record":{"id":"a9478322b9c64528","repo":"kubernetes/kops","slug":"failed-to-find-cluster-dns-zone","errorCode":null,"errorMessage":"failed to find cluster dns zone","messagePattern":"failed to find cluster dns zone","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/resources/openstack/dns.go","lineNumber":52,"sourceCode":"\tif os.osCloud.DNSClient() == nil {\n\t\treturn nil, nil\n\t}\n\n\tzs, err := os.osCloud.ListDNSZones(zones.ListOpts{})\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to list dns zones: %s\", err)\n\t}\n\n\tvar clusterZone zones.Zone\n\tfor _, zone := range zs {\n\t\tif strings.HasSuffix(os.clusterName, strings.TrimSuffix(zone.Name, \".\")) {\n\t\t\tclusterZone = zone\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif clusterZone.ID == \"\" {\n\t\treturn nil, fmt.Errorf(\"failed to find cluster dns zone\")\n\t}\n\n\trrs, err := os.osCloud.ListDNSRecordsets(clusterZone.ID, nil)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to extract recordsets pages for zone %s: %v\", clusterZone.Name, err)\n\t}\n\n\tvar resourceTrackers []*resources.Resource\n\tfor _, rr := range rrs {\n\t\tif rr.Type != \"A\" || !strings.HasSuffix(strings.TrimSuffix(rr.Name, \".\"), os.clusterName) {\n\t\t\tcontinue\n\t\t}\n\n\t\tresourceTracker := &resources.Resource{\n\t\t\tName: rr.Name,\n\t\t\tID:   rr.ID,\n\t\t\tType: typeDNSRecord,\n\t\t\tDeleter: func(cloud fi.Cloud, r *resources.Resource) error {","sourceCodeStart":34,"sourceCodeEnd":70,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/pkg/resources/openstack/dns.go#L34-L70","documentation":"After listing zones, ListDNSRecordsets searches for the zone whose name is a suffix of the cluster name. If no zone matches (clusterZone.ID remains empty), this sentinel error is returned. It means the cluster's DNS zone could not be identified among the account's Designate zones.","triggerScenarios":"No Designate zone name matches the cluster name suffix: zone was deleted/renamed, clusterName doesn't match the zone (e.g., trailing-dot handling or different domain), or the zone lives in a different OpenStack project.","commonSituations":"Cluster created under example.com but that zone was removed from Designate; cluster name using a subdomain that isn't itself a zone; wrong OS_PROJECT_NAME so the zone isn't visible; zone renamed after cluster creation.","solutions":["Create/recreate the DNS zone matching the cluster's domain in Designate","Confirm 'openstack zone list' shows a zone whose name is a suffix of the cluster name","Use the same OpenStack project/credentials the cluster was created with","Check for trailing-dot mismatches between zone name and clusterName","Re-run kops delete once the zone exists"],"exampleFix":"// before\nif clusterZone.ID == \"\" {\n\treturn nil, fmt.Errorf(\"failed to find cluster dns zone\")\n}\n// after\nif clusterZone.ID == \"\" {\n\treturn nil, fmt.Errorf(\"failed to find cluster dns zone for cluster %q; verify a Designate zone exists for the cluster's domain\", os.clusterName)\n}","handlingStrategy":"validation","validationCode":"# Ensure a zone exists whose name is a suffix of the cluster name\nopenstack zone list | grep \"$(echo $CLUSTER_NAME | rev | cut -d. -f1-2 | rev)\"","typeGuard":"func zoneMatchesCluster(zoneName, clusterName string) bool { return strings.HasSuffix(clusterName, strings.TrimSuffix(zoneName, \".\")) }","tryCatchPattern":"zs, err := os.osCloud.ListDNSZones(zones.ListOpts{})\nif err != nil { return nil, err }\nvar clusterZone zones.Zone\nfor _, z := range zs { if zoneMatchesCluster(z.Name, os.clusterName) { clusterZone = z; break } }\nif clusterZone.ID == \"\" { return nil, fmt.Errorf(\"failed to find cluster dns zone for %s\", os.clusterName) }","preventionTips":["Create the Designate zone before creating the cluster","Keep the zone present until after kops delete completes","Use the same OpenStack project the cluster was provisioned in","Watch for trailing-dot/renamed zone mismatches"],"tags":["openstack","designate","dns","zone-lookup","configuration"],"backgroundTag":"dns-zone-not-found","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"}