{"record":{"id":"df779fbe38636e6d","repo":"kubernetes/kops","slug":"error-building-cloudresourcemanager-api-client-w","errorCode":null,"errorMessage":"error building cloudresourcemanager API client: %w","messagePattern":"error building cloudresourcemanager API client: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/gce/gce_cloud.go","lineNumber":168,"sourceCode":"\t\treturn nil, fmt.Errorf(\"error building storage API client: %v\", err)\n\t}\n\tc.storage = storageClient\n\n\tiamService, err := newIamClientImpl(ctx)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error building IAM API client: %v\", err)\n\t}\n\tc.iam = iamService\n\n\tdnsClient, err := newDNSClientImpl(ctx)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error building DNS API client: %v\", err)\n\t}\n\tc.dns = dnsClient\n\n\tcloudResourceManager, err := cloudresourcemanager.NewService(ctx)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error building cloudresourcemanager API client: %w\", err)\n\t}\n\tc.cloudResourceManager = cloudResourceManager\n\n\tCacheGCECloudInstance(region, project, c)\n\n\t{\n\t\t// Attempt to log the current GCE service account in user, for diagnostic purposes\n\t\t// At least until we get e2e running, we're doing this always\n\t\ttokenInfo, err := c.getTokenInfo(ctx)\n\t\tif err != nil {\n\t\t\tklog.Infof(\"unable to get token info: %v\", err)\n\t\t} else {\n\t\t\tklog.V(2).Infof(\"running with GCE credentials: email=%s, scope=%s\", tokenInfo.Email, tokenInfo.Scope)\n\t\t}\n\t}\n\n\treturn c.WithLabels(labels), nil\n}","sourceCodeStart":150,"sourceCodeEnd":186,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/gce/gce_cloud.go#L150-L186","documentation":"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.","triggerScenarios":"Thrown at upup/pkg/fi/cloudup/gce/gce_cloud.go:168 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix Application Default Credentials","Enable the Cloud Resource Manager API","Inspect the wrapped error"],"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"}