kubernetes/kops · error
listing DNS records named %q in zone %q: %w
Error message
listing DNS records named %q in zone %q: %w
What it means
DNSRecord.Find lists DNS zone records via the Scaleway domain API to locate the existing record matching name/zone/type/ID. Any error from the paginated ListDNSZoneRecords call is wrapped in this error.
Source
Thrown at upup/pkg/fi/cloudup/scalewaytasks/dns_record.go:57
}
var _ fi.CloudupTask = (*DNSRecord)(nil)
var _ fi.CompareWithID = (*DNSRecord)(nil)
func (d *DNSRecord) CompareWithID() *string {
return d.ID
}
func (d *DNSRecord) Find(context *fi.CloudupContext) (*DNSRecord, error) {
cloud := context.T.Cloud.(scaleway.ScwCloud)
records, err := cloud.DomainService().ListDNSZoneRecords(&domain.ListDNSZoneRecordsRequest{
ID: d.ID,
DNSZone: fi.ValueOf(d.DNSZone),
Name: fi.ValueOf(d.Name),
Type: domain.RecordType(fi.ValueOf(d.Type)),
}, scw.WithContext(context.Context()), scw.WithAllPages())
if err != nil {
return nil, fmt.Errorf("listing DNS records named %q in zone %q: %w", fi.ValueOf(d.Name), fi.ValueOf(d.DNSZone), err)
}
if records.TotalCount == 0 {
return nil, nil
}
if records.TotalCount > 1 && d.ID != nil {
return nil, fmt.Errorf("expected exactly 1 DNS record with ID %s, got %d", *d.ID, records.TotalCount)
}
recordFound := records.Records[0]
return &DNSRecord{
ID: new(recordFound.ID),
Name: new(recordFound.Name),
Data: new(recordFound.Data),
TTL: new(recordFound.TTL),
DNSZone: d.DNSZone,
Type: new(recordFound.Type.String()),
Lifecycle: d.Lifecycle,View on GitHub (pinned to 4c8573c808)
Solutions
- Verify the DNS zone exists: scw domain zone list
- Check the zone name in the cluster spec matches Scaleway exactly (case and trailing dot)
- Grant domain zone read permission to the kOps credentials
- Retry if it is a transient network/API error
Defensive patterns
Strategy: try-catch
Validate before calling
// check zone exists before listing records
zones, err := cloud.DomainService().ListZones(&domain.ListZonesRequest{}, scw.WithContext(ctx))
if err != nil { return err }
found := false
for _, z := range zones.Zones { if z.Domain == fi.ValueOf(d.DNSZone) { found = true } }
if !found { return fmt.Errorf("DNS zone %q not found in Scaleway", fi.ValueOf(d.DNSZone)) } Type guard
func isZoneNotFound(err error) bool {
var rerr *scw.ResponseError
return errors.As(err, &rerr) && (rerr.StatusCode == 404 || strings.Contains(rerr.Error(), "not found"))
} Try / catch
if err != nil {
var rerr *scw.ResponseError
if errors.As(err, &rerr) && rerr.StatusCode == 404 {
// treat as record-not-found so kOps creates the record instead of failing
return nil, nil
}
return nil, fmt.Errorf("listing DNS records named %q in zone %q: %w", name, zone, err)
} Prevention
- Host the cluster's DNS zone on Scaleway before kops create cluster
- Match zone names exactly (including subdomain/trailing dot) between cluster spec and Scaleway
- Check `scw domain zone list` before running updates
When it happens
Trigger: cloud.DomainService().ListDNSZoneRecords fails — most commonly the DNS zone does not exist, the API credentials lack domain read permission, or a network/API failure occurs.
Common situations: Cluster DNS zone name typo in the kOps cluster spec (e.g. missing trailing dot or wrong subdomain), zone hosted on another registrar without being added in Scaleway, expired/insufficient IAM credentials, or Scaleway API outage.
Related errors
- updating DNS record %q (%s): %w
- creating DNS record %q in zone %q: %w
- failed to get server %s: %w
- error building DNS provider: %w
- failed to delete record %s: %w
AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05).
Data as JSON: /api/errors/1d2701bb66e81cc9.
Report an issue: GitHub.