kubernetes/kops · error
error building DNS API client: %v
Error message
error building DNS API client: %v
What it means
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.
Source
Thrown at upup/pkg/fi/cloudup/gce/dns.go:41
dns "google.golang.org/api/dns/v1"
)
type DNSClient interface {
ManagedZones() ManagedZoneClient
ResourceRecordSets() ResourceRecordSetClient
Changes() ChangeClient
}
type dnsClientImpl struct {
srv *dns.Service
}
var _ DNSClient = (*dnsClientImpl)(nil)
func newDNSClientImpl(ctx context.Context) (*dnsClientImpl, error) {
srv, err := dns.NewService(ctx)
if err != nil {
return nil, fmt.Errorf("error building DNS API client: %v", err)
}
return &dnsClientImpl{
srv: srv,
}, nil
}
func (c *dnsClientImpl) ManagedZones() ManagedZoneClient {
return &managedZoneClientImpl{
srv: c.srv.ManagedZones,
}
}
func (c *dnsClientImpl) ResourceRecordSets() ResourceRecordSetClient {
return &resourceRecordSetClientImpl{
srv: c.srv.ResourceRecordSets,
}
}
View on GitHub (pinned to 4c8573c808)
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
Defensive patterns
Strategy: try-catch
When it happens
Trigger: Thrown at upup/pkg/fi/cloudup/gce/dns.go:41 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05).
Data as JSON: /api/errors/33bd4fa2c705b55c.
Report an issue: GitHub.