{"record":{"id":"965af83b3aef44de","repo":"kubernetes/kops","slug":"failed-to-list-domains-v","errorCode":null,"errorMessage":"failed to list domains: %v","messagePattern":"failed to list domains: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"dnsprovider/pkg/dnsprovider/providers/do/dns.go","lineNumber":430,"sourceCode":"\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\nfunc createDomain(c *godo.Client, createRequest *godo.DomainCreateRequest) (*godo.Domain, error) {\n\tdomain, _, err := c.Domains.Create(context.TODO(), createRequest)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn domain, nil\n}\n\n// deleteDomain deletes a domain given its name\nfunc deleteDomain(c *godo.Client, name string) error {\n\t_, err := c.Domains.Delete(context.TODO(), name)","sourceCodeStart":412,"sourceCodeEnd":448,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/dnsprovider/pkg/dnsprovider/providers/do/dns.go#L412-L448","documentation":"listDomains wraps a failure of the godo Domains.List call (pagination intentionally not implemented per the TODO). It fires when the DigitalOcean API errors while enumerating domains in the account, e.g. invalid token or network failure.","triggerScenarios":"Thrown at dnsprovider/pkg/dnsprovider/providers/do/dns.go:430 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the DigitalOcean API token","Check network connectivity and DO API status","Retry the operation"],"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-12T12:17:11.808Z"}