{"record":{"id":"1a421d944798d6e7","repo":"kubernetes/kops","slug":"updating-dns-record-q-s-w","errorCode":null,"errorMessage":"updating DNS record %q (%s): %w","messagePattern":"updating DNS record %q \\((.+?)\\): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/scalewaytasks/dns_record.go","lineNumber":133,"sourceCode":"\tif actual != nil {\n\t\trecordUpdated, err := t.Cloud.DomainService().UpdateDNSZoneRecords(&domain.UpdateDNSZoneRecordsRequest{\n\t\t\tDNSZone: fi.ValueOf(actual.DNSZone),\n\t\t\tChanges: []*domain.RecordChange{\n\t\t\t\t{\n\t\t\t\t\tSet: &domain.RecordChangeSet{\n\t\t\t\t\t\tID: actual.ID,\n\t\t\t\t\t\tRecords: []*domain.Record{\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tData: fi.ValueOf(expected.Data),\n\t\t\t\t\t\t\t\tTTL:  fi.ValueOf(expected.TTL),\n\t\t\t\t\t\t\t},\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\tif err != nil {\n\t\t\treturn fmt.Errorf(\"updating DNS record %q (%s): %w\", fi.ValueOf(actual.Name), fi.ValueOf(actual.ID), err)\n\t\t}\n\t\texpected.ID = &recordUpdated.Records[0].ID\n\t\treturn nil\n\t}\n\n\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},","sourceCodeStart":115,"sourceCodeEnd":151,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/scalewaytasks/dns_record.go#L115-L151","documentation":"In RenderScw for the DNS record task, the Scaleway Domain API UpdateDNSZoneRecords call failed while applying a 'set' change to an existing record (updating its data/TTL). The record name and ID identify the existing DNS entry being modified; the wrapped error is the SDK response, e.g. zone not found, permissions, or invalid record data.","triggerScenarios":"The UpdateDNSZoneRecords call with a Set change fails — typically because the record ID no longer exists (record deleted out-of-band), the DNS zone changed/invalid, or the new Data/TTL value is rejected by the API (e.g. invalid data for the record type).","commonSituations":"Record deleted manually in the console between Find and update (stale ID), concurrent kOps runs, invalid record data (e.g. malformed A value or wrong CNAME target), or IAM write permission missing.","solutions":["Verify the record ID still exists; if it was deleted, re-run kops update cluster so it is recreated","Validate the record Data format matches its Type (A needs IPv4, CNAME a hostname)","Ensure credentials have domain write permission on the zone","Check the DNS zone name is still valid and active"],"exampleFix":"// before\nData: \"300.1.2.3\"   // invalid for A record\n// after\nData: \"1.2.3.4\"","handlingStrategy":"try-catch","validationCode":"// validate record data matches type before update\nswitch domain.RecordType(fi.ValueOf(expected.Type)) {\ncase domain.RecordTypeA:\n\tif net.ParseIP(fi.ValueOf(expected.Data)) == nil || strings.Contains(fi.ValueOf(expected.Data), \":\") {\n\t\treturn fmt.Errorf(\"invalid A record data %q\", fi.ValueOf(expected.Data))\n\t}\n}","typeGuard":"func isNotFound(err error) bool {\n\tvar rerr *scw.ResponseError\n\treturn errors.As(err, &rerr) && rerr.StatusCode == 404\n}","tryCatchPattern":"if err != nil {\n\tvar rerr *scw.ResponseError\n\tif errors.As(err, &rerr) && rerr.StatusCode == 404 {\n\t\t// record deleted out-of-band: fall back to create path\n\t\treturn d.RenderScw(t, nil, expected, changes)\n\t}\n\treturn fmt.Errorf(\"updating DNS record %q (%s): %w\", name, id, err)\n}","preventionTips":["Re-run kops update after manual console changes so stale IDs are re-Find'd","Validate record Data against its Type in the cluster spec","Ensure credentials retain domain write permission"],"tags":["scaleway","dns","update","api"],"backgroundTag":"dns-record-update-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"}