{"record":{"id":"f068bfd555644172","repo":"kubernetes/kops","slug":"error-getting-targetpool-q-v-f068bf","errorCode":null,"errorMessage":"error getting TargetPool %q: %v","messagePattern":"error getting TargetPool %q: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/gcetasks/targetpool.go","lineNumber":54,"sourceCode":"\tLifecycle fi.Lifecycle\n}\n\nvar _ fi.CompareWithID = (*TargetPool)(nil)\n\nfunc (e *TargetPool) CompareWithID() *string {\n\treturn e.Name\n}\n\nfunc (e *TargetPool) Find(c *fi.CloudupContext) (*TargetPool, error) {\n\tcloud := c.T.Cloud.(gce.GCECloud)\n\tname := fi.ValueOf(e.Name)\n\n\tr, err := cloud.Compute().TargetPools().Get(cloud.Project(), cloud.Region(), name)\n\tif err != nil {\n\t\tif gce.IsNotFound(err) {\n\t\t\treturn nil, nil\n\t\t}\n\t\treturn nil, fmt.Errorf(\"error getting TargetPool %q: %v\", name, err)\n\t}\n\n\tactual := &TargetPool{}\n\tactual.Name = new(r.Name)\n\n\t// Avoid spurious changes\n\tactual.HealthCheck = e.HealthCheck\n\tactual.Lifecycle = e.Lifecycle\n\n\treturn actual, nil\n}\n\nfunc (e *TargetPool) Run(c *fi.CloudupContext) error {\n\treturn fi.CloudupDefaultDeltaRunMethod(e, c)\n}\n\nfunc (_ *TargetPool) CheckChanges(a, e, changes *TargetPool) error {\n\tif fi.ValueOf(e.Name) == \"\" {","sourceCodeStart":36,"sourceCodeEnd":72,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/gcetasks/targetpool.go#L36-L72","documentation":"In TargetPool.Find, kOps looks up the GCE TargetPool by name to compare actual vs desired state. Non-NotFound errors from TargetPools().Get are wrapped in this error. NotFound is treated as 'target pool doesn't exist yet' and returns nil,nil instead.","triggerScenarios":"Compute().TargetPools().Get(project, region, name) returns an error other than 404: API outage, permission denied, malformed name, or region mismatch.","commonSituations":"GCP IAM role lacking compute.targetPools.get; regional API endpoint temporarily unavailable; region configured in the cluster spec differs from where the target pool lives; expired service-account credentials.","solutions":["Read the wrapped %v error to distinguish 403 vs 5xx vs network failure","Verify the service account has compute.targetPools.get IAM permission","Confirm the cluster spec region matches the target pool's region","Retry after transient GCP API failures","Refresh credentials if the error is auth-related"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"gcloud compute target-pools describe <name> --region <region> >/dev/null 2>&1 || echo 'will be created'","typeGuard":null,"tryCatchPattern":"if gce.IsNotFound(err) { return nil, nil } // only non-404 errors matter; inspect code 403 vs 5xx","preventionTips":["Grant compute.targetPools.get to the kOps service account","Keep cluster spec region consistent with existing resources","Refresh service-account keys before long CI runs"],"tags":["gcp","gce","targetpool","load-balancing"],"backgroundTag":"cloud-api-get-failed","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"}