kubernetes/kops · error

error building DNS API client: %v

Error message

error building DNS API client: %v

What it means

NewGCECloud wraps newDNSClientImpl failure while building the Cloud DNS client — the fourth sequential API client constructed when a new GCE cloud instance is created. Credential or service-initialization failure aborts NewGCECloud.

Source

Thrown at upup/pkg/fi/cloudup/gce/gce_cloud.go:162

		return nil, fmt.Errorf("error building compute API client: %v", err)
	}
	c.compute = computeClient

	storageClient, err := storage.NewClient(ctx)
	if err != nil {
		return nil, fmt.Errorf("error building storage API client: %v", err)
	}
	c.storage = storageClient

	iamService, err := newIamClientImpl(ctx)
	if err != nil {
		return nil, fmt.Errorf("error building IAM API client: %v", err)
	}
	c.iam = iamService

	dnsClient, err := newDNSClientImpl(ctx)
	if err != nil {
		return nil, fmt.Errorf("error building DNS API client: %v", err)
	}
	c.dns = dnsClient

	cloudResourceManager, err := cloudresourcemanager.NewService(ctx)
	if err != nil {
		return nil, fmt.Errorf("error building cloudresourcemanager API client: %w", err)
	}
	c.cloudResourceManager = cloudResourceManager

	CacheGCECloudInstance(region, project, c)

	{
		// Attempt to log the current GCE service account in user, for diagnostic purposes
		// At least until we get e2e running, we're doing this always
		tokenInfo, err := c.getTokenInfo(ctx)
		if err != nil {
			klog.Infof("unable to get token info: %v", err)
		} else {

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Fix Application Default Credentials
  2. Enable the DNS API on the project
  3. Check the wrapped error
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at upup/pkg/fi/cloudup/gce/gce_cloud.go:162 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/aa527786c4e10295. Report an issue: GitHub.