{"record":{"id":"85204c3cae5f9429","repo":"kubernetes/kops","slug":"error-building-compute-api-client-v-85204c","errorCode":null,"errorMessage":"error building compute API client: %v","messagePattern":"error building compute API client: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/gce/compute.go","lineNumber":56,"sourceCode":"\tRouters() RouterClient\n\tInstances() InstanceClient\n\tInstanceTemplates() InstanceTemplateClient\n\tInstanceGroupManagers() InstanceGroupManagerClient\n\tTargetPools() TargetPoolClient\n\tDisks() DiskClient\n\tRegionBackendServices() RegionBackendServiceClient\n}\n\ntype computeClientImpl struct {\n\tsrv *compute.Service\n}\n\nvar _ ComputeClient = (*computeClientImpl)(nil)\n\nfunc newComputeClientImpl(ctx context.Context) (*computeClientImpl, error) {\n\tsrv, err := compute.NewService(ctx)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error building compute API client: %v\", err)\n\t}\n\treturn &computeClientImpl{\n\t\tsrv: srv,\n\t}, nil\n}\n\nfunc (c *computeClientImpl) Projects() ProjectClient {\n\treturn &projectClientImpl{\n\t\tsrv: c.srv.Projects,\n\t}\n}\n\nfunc (c *computeClientImpl) Regions() RegionClient {\n\treturn &regionClientImpl{\n\t\tsrv: c.srv.Regions,\n\t}\n}\n","sourceCodeStart":38,"sourceCodeEnd":74,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/gce/compute.go#L38-L74","documentation":"Wraps compute.NewService failure while constructing the GCE compute API client. Fires when Application Default Credentials cannot be obtained or initialized — missing gcloud auth, no GOOGLE_APPLICATION_CREDENTIALS, or no attached service account.","triggerScenarios":"Thrown at upup/pkg/fi/cloudup/gce/compute.go:56 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Run `gcloud auth application-default login` or set GOOGLE_APPLICATION_CREDENTIALS","Verify the credentials file is valid JSON and readable","Check the wrapped error for the ADC failure reason"],"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"}