kubernetes/kops · error

error building storage API client: %v

Error message

error building storage API client: %v

What it means

NewGCECloud wraps storage.NewClient failure while creating the Cloud Storage client (used for asset/state access). It fires when Google credentials/default token source cannot be established; GCE cloud construction aborts after the compute client succeeded.

Source

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

	klog.V(2).Infof("Building new GCE cloud instance for region %q and project %q", region, project)

	c := &gceCloudImplementation{region: region, project: project}

	ctx := context.Background()

	if os.Getenv("GOOGLE_APPLICATION_CREDENTIALS") != "" {
		klog.Infof("Will load GOOGLE_APPLICATION_CREDENTIALS from %s", os.Getenv("GOOGLE_APPLICATION_CREDENTIALS"))
	}

	computeClient, err := newComputeClientImpl(ctx)
	if err != nil {
		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)

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Fix Application Default Credentials
  2. Check network access to storage.googleapis.com
  3. Inspect the wrapped error
Defensive patterns

Strategy: try-catch

When it happens

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