{"record":{"id":"0073c6d5edf937de","repo":"kubernetes/kops","slug":"error-cleaning-up-old-records-v","errorCode":null,"errorMessage":"error cleaning up old records: %v","messagePattern":"error cleaning up old records: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"dnsprovider/pkg/dnsprovider/providers/do/dns.go","lineNumber":418,"sourceCode":"\t}\n\n\tfor _, rrdata := range rrset.Rrdatas() {\n\t\trecordCreateRequest := &godo.DomainRecordEditRequest{\n\t\t\tName: rrset.Name(),\n\t\t\tData: rrdata,\n\t\t\tTTL:  int(rrset.Ttl()),\n\t\t\tType: string(rrset.Type()),\n\t\t}\n\t\terr := createRecord(r.client, r.zone.Name(), recordCreateRequest)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"could not create record: %v\", err)\n\t\t}\n\t}\n\n\tfor _, record := range deleteRecords {\n\t\terr := deleteRecord(r.client, r.zone.Name(), record.ID)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error cleaning up old records: %v\", err)\n\t\t}\n\t}\n\n\treturn nil\n}\n\n// listDomains returns a list of godo.Domain\nfunc listDomains(c *godo.Client) ([]godo.Domain, error) {\n\t// TODO (andrewsykim): pagination in ListOptions\n\tdomains, _, err := c.Domains.List(context.TODO(), &godo.ListOptions{})\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to list domains: %v\", err)\n\t}\n\n\treturn domains, err\n}\n\n// createDomain creates a domain provided godo.DomainCreateRequest","sourceCodeStart":400,"sourceCodeEnd":436,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/dnsprovider/pkg/dnsprovider/providers/do/dns.go#L400-L436","documentation":"Wraps a failure of deleteRecord in the DigitalOcean DNS provider during changeset apply: after successfully creating the new records, deleting the superseded records with the same name failed, leaving potential duplicates.","triggerScenarios":"Thrown at dnsprovider/pkg/dnsprovider/providers/do/dns.go:418 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Manually inspect and dedupe records in the DO dashboard","Re-run the DNS apply","Check API token delete permissions"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}