kubernetes/kops · error

error building cloudresourcemanager API client: %w

Error message

error building cloudresourcemanager API client: %w

What it means

NewGCECloud wraps cloudresourcemanager.NewService failure while building the Resource Manager client (project/permission queries). It is the last client built during GCE cloud construction; failure here likewise aborts with the cause wrapped via %w.

Source

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

		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 {
			klog.V(2).Infof("running with GCE credentials: email=%s, scope=%s", tokenInfo.Email, tokenInfo.Scope)
		}
	}

	return c.WithLabels(labels), nil
}

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Fix Application Default Credentials
  2. Enable the Cloud Resource Manager API
  3. Inspect the wrapped error
Defensive patterns

Strategy: try-catch

When it happens

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