{"record":{"id":"146bd61b7a6aaae7","repo":"kubernetes/kops","slug":"error-creating-targetpool-q-v","errorCode":null,"errorMessage":"error creating TargetPool %q: %v","messagePattern":"error creating TargetPool %q: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/gcetasks/targetpool.go","lineNumber":96,"sourceCode":"func (e *TargetPool) URL(cloud gce.GCECloud) string {\n\tname := fi.ValueOf(e.Name)\n\n\treturn fmt.Sprintf(\"https://www.googleapis.com/compute/v1/projects/%s/regions/%s/targetPools/%s\", cloud.Project(), cloud.Region(), name)\n}\n\nfunc (_ *TargetPool) RenderGCE(t *gce.GCEAPITarget, a, e, changes *TargetPool) error {\n\tname := fi.ValueOf(e.Name)\n\n\to := &compute.TargetPool{\n\t\tName: name,\n\t}\n\n\tif a == nil {\n\t\tklog.V(4).Infof(\"Creating TargetPool %q\", o.Name)\n\n\t\top, err := t.Cloud.Compute().TargetPools().Insert(t.Cloud.Project(), t.Cloud.Region(), o)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error creating TargetPool %q: %v\", name, err)\n\t\t}\n\n\t\tif err := t.Cloud.WaitForOp(op); err != nil {\n\t\t\treturn fmt.Errorf(\"error creating TargetPool: %v\", err)\n\t\t}\n\t} else {\n\t\treturn fmt.Errorf(\"cannot apply changes to TargetPool: %v\", changes)\n\t}\n\n\treturn nil\n}\n\ntype terraformTargetPool struct {\n\tName         string                     `cty:\"name\"`\n\tHealthChecks []*terraformWriter.Literal `cty:\"health_checks\"`\n}\n\nfunc (_ *TargetPool) RenderTerraform(t *terraform.TerraformTarget, a, e, changes *TargetPool) error {","sourceCodeStart":78,"sourceCodeEnd":114,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/gcetasks/targetpool.go#L78-L114","documentation":"When a TargetPool needs to be created (actual == nil), RenderGCE calls TargetPools().Insert and wraps any immediate API error in this message. It means GCE rejected the creation request synchronously.","triggerScenarios":"TargetPools().Insert(project, region, o) returns an error: invalid target pool definition, quota exceeded (target pools per project/region), duplicate name conflict, or IAM/API failure.","commonSituations":"Exceeding the GCP target-pool quota in a region with many legacy LBs; name collision with a manually created target pool; inserting into a region that doesn't exist or isn't enabled for the project; permission denied after IAM tightening.","solutions":["Check target pool quota: `gcloud compute target-pools list` and project quotas","Verify no name conflict with an existing target pool in the region","Confirm IAM permissions (compute.targetPools.create)","Inspect the wrapped error with -v=10 for the exact API rejection","Retry if the failure was transient"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"gcloud compute target-pools list --filter=\"name=<name> AND region=<region>\" --format='value(name)'","typeGuard":null,"tryCatchPattern":"if gerr, ok := err.(*googleapi.Error); ok && gerr.Code == 409 { /* name conflict: adopt or rename */ }","preventionTips":["Monitor target pool quota in the region","Avoid manually creating resources with kOps-managed names","Verify region is valid and enabled for the project"],"tags":["gcp","gce","targetpool","load-balancing"],"backgroundTag":"cloud-resource-create-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"}