{"record":{"id":"33bd4fa2c705b55c","repo":"kubernetes/kops","slug":"error-building-dns-api-client-v","errorCode":null,"errorMessage":"error building DNS API client: %v","messagePattern":"error building DNS API client: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/gce/dns.go","lineNumber":41,"sourceCode":"\tdns \"google.golang.org/api/dns/v1\"\n)\n\ntype DNSClient interface {\n\tManagedZones() ManagedZoneClient\n\tResourceRecordSets() ResourceRecordSetClient\n\tChanges() ChangeClient\n}\n\ntype dnsClientImpl struct {\n\tsrv *dns.Service\n}\n\nvar _ DNSClient = (*dnsClientImpl)(nil)\n\nfunc newDNSClientImpl(ctx context.Context) (*dnsClientImpl, error) {\n\tsrv, err := dns.NewService(ctx)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error building DNS API client: %v\", err)\n\t}\n\treturn &dnsClientImpl{\n\t\tsrv: srv,\n\t}, nil\n}\n\nfunc (c *dnsClientImpl) ManagedZones() ManagedZoneClient {\n\treturn &managedZoneClientImpl{\n\t\tsrv: c.srv.ManagedZones,\n\t}\n}\n\nfunc (c *dnsClientImpl) ResourceRecordSets() ResourceRecordSetClient {\n\treturn &resourceRecordSetClientImpl{\n\t\tsrv: c.srv.ResourceRecordSets,\n\t}\n}\n","sourceCodeStart":23,"sourceCodeEnd":59,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/gce/dns.go#L23-L59","documentation":"newDNSClientImpl wraps dns.NewService failure when constructing the Google Cloud DNS API client for GCE clusters. It fires when Google credentials cannot be resolved or the DNS API client cannot initialize; NewGCECloud aborts cloud construction since DNS operations (managed zones, record sets) depend on it.","triggerScenarios":"Thrown at upup/pkg/fi/cloudup/gce/dns.go:41 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Authenticate with `gcloud auth application-default login`","Set GOOGLE_APPLICATION_CREDENTIALS to a valid key file","Inspect the wrapped error for the credential failure"],"exampleFix":null,"handlingStrategy":"try-catch","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"}