{"record":{"id":"1d2701bb66e81cc9","repo":"kubernetes/kops","slug":"listing-dns-records-named-q-in-zone-q-w","errorCode":null,"errorMessage":"listing DNS records named %q in zone %q: %w","messagePattern":"listing DNS records named %q in zone %q: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/scalewaytasks/dns_record.go","lineNumber":57,"sourceCode":"}\n\nvar _ fi.CloudupTask = (*DNSRecord)(nil)\nvar _ fi.CompareWithID = (*DNSRecord)(nil)\n\nfunc (d *DNSRecord) CompareWithID() *string {\n\treturn d.ID\n}\n\nfunc (d *DNSRecord) Find(context *fi.CloudupContext) (*DNSRecord, error) {\n\tcloud := context.T.Cloud.(scaleway.ScwCloud)\n\trecords, err := cloud.DomainService().ListDNSZoneRecords(&domain.ListDNSZoneRecordsRequest{\n\t\tID:      d.ID,\n\t\tDNSZone: fi.ValueOf(d.DNSZone),\n\t\tName:    fi.ValueOf(d.Name),\n\t\tType:    domain.RecordType(fi.ValueOf(d.Type)),\n\t}, scw.WithContext(context.Context()), scw.WithAllPages())\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"listing DNS records named %q in zone %q: %w\", fi.ValueOf(d.Name), fi.ValueOf(d.DNSZone), err)\n\t}\n\n\tif records.TotalCount == 0 {\n\t\treturn nil, nil\n\t}\n\tif records.TotalCount > 1 && d.ID != nil {\n\t\treturn nil, fmt.Errorf(\"expected exactly 1 DNS record with ID %s, got %d\", *d.ID, records.TotalCount)\n\t}\n\trecordFound := records.Records[0]\n\n\treturn &DNSRecord{\n\t\tID:        new(recordFound.ID),\n\t\tName:      new(recordFound.Name),\n\t\tData:      new(recordFound.Data),\n\t\tTTL:       new(recordFound.TTL),\n\t\tDNSZone:   d.DNSZone,\n\t\tType:      new(recordFound.Type.String()),\n\t\tLifecycle: d.Lifecycle,","sourceCodeStart":39,"sourceCodeEnd":75,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/scalewaytasks/dns_record.go#L39-L75","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// check zone exists before listing records\nzones, err := cloud.DomainService().ListZones(&domain.ListZonesRequest{}, scw.WithContext(ctx))\nif err != nil { return err }\nfound := false\nfor _, z := range zones.Zones { if z.Domain == fi.ValueOf(d.DNSZone) { found = true } }\nif !found { return fmt.Errorf(\"DNS zone %q not found in Scaleway\", fi.ValueOf(d.DNSZone)) }","typeGuard":"func isZoneNotFound(err error) bool {\n\tvar rerr *scw.ResponseError\n\treturn errors.As(err, &rerr) && (rerr.StatusCode == 404 || strings.Contains(rerr.Error(), \"not found\"))\n}","tryCatchPattern":"if err != nil {\n\tvar rerr *scw.ResponseError\n\tif errors.As(err, &rerr) && rerr.StatusCode == 404 {\n\t\t// treat as record-not-found so kOps creates the record instead of failing\n\t\treturn nil, nil\n\t}\n\treturn nil, fmt.Errorf(\"listing DNS records named %q in zone %q: %w\", name, zone, err)\n}","preventionTips":["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"],"tags":["scaleway","dns","domain","api"],"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-12T12:17:11.808Z"}