{"record":{"id":"e0e698b9aab24dd4","repo":"kubernetes/kops","slug":"error-getting-dns-zones-provider","errorCode":null,"errorMessage":"error getting DNS zones provider","messagePattern":"error getting DNS zones provider","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/dns.go","lineNumber":57,"sourceCode":")\n\ntype recordKey struct {\n\thostname string\n\trrsType  rrstype.RrsType\n}\n\nfunc findZone(cluster *kops.Cluster, cloud fi.Cloud) (dnsprovider.Zone, error) {\n\tdns, err := cloud.DNS()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error building DNS provider: %v\", err)\n\t}\n\tif dns == nil {\n\t\treturn nil, nil\n\t}\n\n\tzonesProvider, ok := dns.Zones()\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"error getting DNS zones provider\")\n\t}\n\n\tzones, err := zonesProvider.List()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error listing DNS zones: %v\", err)\n\t}\n\n\tvar matches []dnsprovider.Zone\n\tfindName := strings.TrimSuffix(cluster.Spec.DNSZone, \".\")\n\tfor _, zone := range zones {\n\t\tid := zone.ID()\n\t\tname := strings.TrimSuffix(zone.Name(), \".\")\n\t\tif id == cluster.Spec.DNSZone || name == findName {\n\t\t\tmatches = append(matches, zone)\n\t\t}\n\t}\n\tif len(matches) == 0 {\n\t\treturn nil, fmt.Errorf(\"cannot find DNS Zone %q.  Please pre-create the zone and set up NS records so that it resolves\", cluster.Spec.DNSZone)","sourceCodeStart":39,"sourceCodeEnd":75,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/dns.go#L39-L75","documentation":"After building the DNS provider, findZone calls dns.Zones() which returns (ZonesProvider, bool). The bool is false when the dnsprovider implementation does not support zone enumeration; kOps then fails with 'error getting DNS zones provider'. This is an interface-capability check, not an API failure.","triggerScenarios":"findZone on a DNS provider whose Zones() reports unsupported — e.g. a dnsprovider plugin/implementation lacking the Zones interface, or a cloud DNS driver that only supports record management without zone listing.","commonSituations":"Using a DNS provider integration that does not implement zone listing; misconfigured driver registration so the wrong dnsprovider implementation is selected; custom/older dnsprovider builds.","solutions":["Use a DNS provider supported by kOps for zone enumeration (Route53, Google Cloud DNS, Azure DNS)","Verify the correct dnsprovider plugin/driver is registered for your cloud","Check kOps version compatibility with the chosen DNS provider and upgrade if needed"],"exampleFix":"// before\nspec:\n  dnsZone: \"unsupported-dns.example\"\n// after: switch cluster DNS to a supported provider, e.g.\nspec:\n  dnsZone: \"example.com\"  # hosted in Route53/Azure DNS/Cloud DNS","handlingStrategy":"type-guard","validationCode":"dns, err := cloud.DNS()\nif err != nil || dns == nil {\n    return errors.New(\"cloud does not provide a DNS provider\")\n}\nif _, ok := dns.Zones(); !ok {\n    return errors.New(\"DNS provider does not support zone listing\")\n}","typeGuard":"func supportsZoneListing(d dnsprovider.Interface) bool {\n    _, ok := d.Zones()\n    return ok\n}","tryCatchPattern":null,"preventionTips":["Use only kOps-supported DNS providers (Route53, Cloud DNS, Azure DNS)","Check dnsprovider interface support before zone operations","Keep the kOps binary and dnsprovider plugins in sync"],"tags":["dns","dnsprovider","zone-lookup"],"backgroundTag":"dns-provider-unsupported","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"}