{"record":{"id":"cf1baef278894897","repo":"kubernetes/kops","slug":"failed-to-list-dns-zones-s","errorCode":null,"errorMessage":"failed to list dns zones: %s","messagePattern":"failed to list dns zones: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/resources/openstack/dns.go","lineNumber":40,"sourceCode":"\n\t\"github.com/gophercloud/gophercloud/v2/openstack/dns/v2/zones\"\n\t\"k8s.io/kops/pkg/resources\"\n\t\"k8s.io/kops/upup/pkg/fi\"\n)\n\nconst (\n\ttypeDNSRecord = \"DNSRecord\"\n)\n\nfunc (os *clusterDiscoveryOS) ListDNSRecordsets() ([]*resources.Resource, error) {\n\t// Designate is optional in OpenStack.\n\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}","sourceCodeStart":22,"sourceCodeEnd":58,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/pkg/resources/openstack/dns.go#L22-L58","documentation":"In the OpenStack resource cleanup, ListDNSRecordsets first lists DNS zones via the OpenStack Designate client. If ListDNSZones fails, the error is wrapped with this message and returned. It means the Designate API request for zones failed.","triggerScenarios":"os.osCloud.ListDNSZones(zones.ListOpts{}) errors: missing/invalid OpenStack credentials, no access to the DNS service endpoint, network failure, or Keystone auth token expired.","commonSituations":"Designate not deployed in the cloud (endpoint missing), OS_* environment variables unset or wrong project, expired tokens, DNS service quotas or RBAC denying zone listing.","solutions":["Verify OpenStack credentials (OS_USERNAME/OS_PASSWORD/OS_PROJECT/OS_AUTH_URL) via 'openstack zone list'","Confirm the Designate service endpoint exists in the catalog","Re-source the correct openrc file","Check project RBAC allows listing DNS zones","Retry after transient network/auth errors"],"exampleFix":"// before\nzs, err := os.osCloud.ListDNSZones(zones.ListOpts{})\nif err != nil {\n\treturn nil, fmt.Errorf(\"failed to list dns zones: %s\", err)\n}\n// after\nzs, err := os.osCloud.ListDNSZones(zones.ListOpts{})\nif err != nil {\n\treturn nil, fmt.Errorf(\"failed to list dns zones: %w\", err)\n}","handlingStrategy":"validation","validationCode":"# Verify credentials and Designate access before running kops delete\nopenstack zone list || echo \"fix OS_* credentials / Designate endpoint\"","typeGuard":"func isAuthError(err error) bool { _, ok := err.(gophercloud.ErrDefault401); return ok }","tryCatchPattern":"zs, err := os.osCloud.ListDNSZones(zones.ListOpts{})\nif err != nil {\n\treturn nil, fmt.Errorf(\"failed to list dns zones: %w\", err)\n}","preventionTips":["Source the correct openrc before cluster operations","Confirm Designate is deployed and its endpoint is in the catalog","Refresh tokens for long-running deletes","Test 'openstack zone list' first"],"tags":["openstack","designate","dns","api-error","auth"],"backgroundTag":"openstack-api-request-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"}