{"record":{"id":"deceaa8bf606727d","repo":"kubernetes/kops","slug":"creating-dns-record-q-in-zone-q-w","errorCode":null,"errorMessage":"creating DNS record %q in zone %q: %w","messagePattern":"creating DNS record %q in zone %q: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/scalewaytasks/dns_record.go","lineNumber":157,"sourceCode":"\trecordCreated, err := t.Cloud.DomainService().UpdateDNSZoneRecords(&domain.UpdateDNSZoneRecordsRequest{\n\t\tDNSZone: fi.ValueOf(expected.DNSZone),\n\t\tChanges: []*domain.RecordChange{\n\t\t\t{\n\t\t\t\tAdd: &domain.RecordChangeAdd{\n\t\t\t\t\tRecords: []*domain.Record{\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tData: fi.ValueOf(expected.Data),\n\t\t\t\t\t\t\tName: fi.ValueOf(expected.Name),\n\t\t\t\t\t\t\tTTL:  fi.ValueOf(expected.TTL),\n\t\t\t\t\t\t\tType: domain.RecordType(fi.ValueOf(expected.Type)),\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"creating DNS record %q in zone %q: %w\", fi.ValueOf(expected.Name), fi.ValueOf(expected.DNSZone), err)\n\t}\n\n\texpected.ID = &recordCreated.Records[0].ID\n\n\treturn nil\n}\n\ntype terraformDNSRecord struct {\n\tName      *string              `cty:\"name\"`\n\tData      *string              `cty:\"data\"`\n\tDNSZone   *string              `cty:\"dns_zone\"`\n\tType      *string              `cty:\"type\"`\n\tTTL       *int32               `cty:\"ttl\"`\n\tLifecycle *terraform.Lifecycle `cty:\"lifecycle\"`\n}\n\nfunc (_ *DNSRecord) RenderTerraform(t *terraform.TerraformTarget, actual, expected, changes *DNSRecord) error {\n\ttf := terraformDNSRecord{","sourceCodeStart":139,"sourceCodeEnd":175,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/scalewaytasks/dns_record.go#L139-L175","documentation":"In RenderScw for the DNS record task, the Scaleway Domain API UpdateDNSZoneRecords call failed while applying an 'add' change — creating a new DNS record with the expected name/type/TTL/data in the given DNS zone. The wrapped error carries the SDK cause (invalid zone, duplicate record, permissions).","triggerScenarios":"UpdateDNSZoneRecords with an Add change fails — commonly because the DNS zone does not exist or is not served by Scaleway, the record payload is invalid (bad data/type/TTL), or credentials lack write permission.","commonSituations":"Zone not configured in Scaleway (domain hosted elsewhere), invalid record data in the cluster spec, IAM policy missing domain write, or transient Scaleway API outage.","solutions":["Confirm the zone exists in Scaleway (scw domain zone get <zone>) or move DNS hosting to Scaleway","Validate record Data/Type/TTL values in the cluster spec","Grant domain write permission to kOps credentials","Retry if transient; check Scaleway status page for incidents"],"exampleFix":"// before\nkubernetesCluster.example.com  # zone that is not hosted on Scaleway\n// after\nexample.com                    # zone hosted/validated in Scaleway","handlingStrategy":"try-catch","validationCode":"// confirm zone exists and is writable before adding records\nzoneResp, err := cloud.DomainService().GetZone(&domain.GetZoneRequest{DNSZone: fi.ValueOf(expected.DNSZone)})\nif err != nil {\n\treturn fmt.Errorf(\"zone %q unavailable for records: %w\", fi.ValueOf(expected.DNSZone), err)\n}\n_ = zoneResp","typeGuard":"func isValidRecordData(rtype string, data string) bool {\n\tswitch rtype {\n\tcase \"A\":\n\t\tip := net.ParseIP(data)\n\t\treturn ip != nil && ip.To4() != nil\n\tcase \"AAAA\":\n\t\tip := net.ParseIP(data)\n\t\treturn ip != nil && ip.To4() == nil\n\tcase \"CNAME\":\n\t\treturn strings.HasSuffix(data, \".\")\n\t}\n\treturn data != \"\"\n}","tryCatchPattern":"if err != nil {\n\tvar rerr *scw.ResponseError\n\tif errors.As(err, &rerr) && (rerr.StatusCode == 429 || rerr.StatusCode >= 500) {\n\t\t// retry create with backoff\n\t}\n\treturn fmt.Errorf(\"creating DNS record %q in zone %q: %w\", name, zone, err)\n}","preventionTips":["Delegate/transfer the cluster domain's zone to Scaleway before provisioning","Validate record Data/Type/TTL in the cluster spec up front","Keep domain write permissions on the kOps service account"],"tags":["scaleway","dns","create","api"],"backgroundTag":"dns-record-create-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"}