kubernetes/kops · error

failed to list dns zones: %s

Error message

failed to list dns zones: %s

What it means

Error returned when listing Designate DNS zones fails inside listDNSZones, which is wrapped in vfs.RetryWithBackoff so only persistent failures surface. kOps needs the zone list for DNS-based cluster records.

Source

Thrown at upup/pkg/fi/cloudup/openstack/dns.go:40

	"github.com/gophercloud/gophercloud/v2/openstack/dns/v2/recordsets"
	"github.com/gophercloud/gophercloud/v2/openstack/dns/v2/zones"
	"k8s.io/apimachinery/pkg/util/wait"
	"k8s.io/kops/util/pkg/vfs"
)

// ListDNSZones will list available DNS zones
func (c *openstackCloud) ListDNSZones(opt zones.ListOptsBuilder) ([]zones.Zone, error) {
	return listDNSZones(c, opt)
}

func listDNSZones(c OpenstackCloud, opt zones.ListOptsBuilder) ([]zones.Zone, error) {
	var zs []zones.Zone

	done, err := vfs.RetryWithBackoff(readBackoff, func() (bool, error) {
		allPages, err := zones.List(c.DNSClient(), opt).AllPages(context.TODO())
		if err != nil {
			return false, fmt.Errorf("failed to list dns zones: %s", err)
		}
		r, err := zones.ExtractZones(allPages)
		if err != nil {
			return false, fmt.Errorf("failed to extract dns zone pages: %s", err)
		}
		zs = r
		return true, nil
	})
	if err != nil {
		return zs, err
	} else if done {
		return zs, nil
	} else {
		return zs, wait.ErrWaitTimeout
	}
}

func deleteDNSRecordset(c OpenstackCloud, zoneID string, rrsetID string) error {

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Verify Designate works: `openstack zone list`
  2. Ensure the Keystone catalog has a dns (designate) endpoint or set the DNS endpoint override in the cloud config
  3. Check credentials/permission to list zones in the project
  4. If Designate is absent, switch the cluster's DNS configuration to a supported provider
Defensive patterns

Strategy: retry

Validate before calling

// preflight
pages, err := zones.List(dnsClient, zones.ListOpts{}).AllPages(ctx)
if err != nil { return fmt.Errorf("designate unreachable: %v", err) }

Try / catch

done, err := vfs.RetryWithBackoff(readBackoff, func() (bool, error) {
    if _, err := zones.List(c.DNSClient(), opt).AllPages(context.TODO()); err != nil {
        return false, fmt.Errorf("failed to list dns zones: %s", err) // only surfaces after retries exhaust
    }
    return true, nil
})

Prevention

When it happens

Trigger: zones.List(c.DNSClient(), opt).AllPages(context.TODO()) errors persistently across retries: Designate API down, DNS client not initialized (no dns endpoint in catalog), auth failure, or invalid ListOpts filter.

Common situations: Designate not deployed while kops configured to use it; missing 'dns' service endpoint in Keystone catalog; wrong OS_DNS_ENDPOINT override; expired token; project lacking view permission on zones.

Related errors


AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05). Data as JSON: /api/errors/03022f5a17d25987. Report an issue: GitHub.