{"record":{"id":"5c4ce6ff8b780a16","repo":"kubernetes/kops","slug":"found-multiple-pools-with-name-s","errorCode":null,"errorMessage":"found multiple pools with name: %s","messagePattern":"found multiple pools with name: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/openstacktasks/poolassociation.go","lineNumber":82,"sourceCode":"\treturn s.ID\n}\n\nfunc (p *PoolAssociation) Find(context *fi.CloudupContext) (*PoolAssociation, error) {\n\tcloud := context.T.Cloud.(openstack.OpenstackCloud)\n\n\topt := v2pools.ListOpts{\n\t\tName: fi.ValueOf(p.Pool.Name),\n\t\tID:   fi.ValueOf(p.Pool.ID),\n\t}\n\n\trs, err := cloud.ListPools(opt)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif rs == nil {\n\t\treturn nil, nil\n\t} else if len(rs) != 1 {\n\t\treturn nil, fmt.Errorf(\"found multiple pools with name: %s\", fi.ValueOf(p.Pool.Name))\n\t}\n\n\ta := rs[0]\n\t// check is member already created\n\tvar found *v2pools.Member\n\tfor _, member := range a.Members {\n\t\tpoolMember, err := cloud.GetPoolMember(a.ID, member.ID)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif fi.ValueOf(p.Name) == poolMember.Name {\n\t\t\tfound = poolMember\n\t\t\tbreak\n\t\t}\n\t}\n\t// if not found it is created by returning nil, nil\n\t// this is needed for instance in initial installation\n\tif found == nil {","sourceCodeStart":64,"sourceCodeEnd":100,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/openstacktasks/poolassociation.go#L64-L100","documentation":"PoolAssociation.Find lists Octavia pools filtered by the desired pool name/ID and requires exactly one match to build the actual state. If the filtered list returns more than one pool, kOps refuses to guess and returns this error, because pool identity is resolved by name.","triggerScenarios":"cloud.ListPools with ListOpts{Name, ID} returns len(rs) != 1 and > 1: two Octavia loadbalancer pools share the same name in the project (e.g. duplicated by a previous partial run, manual creation, or cross-project copy).","commonSituations":"A previous failed `kops update cluster` left duplicate pools; an operator manually created a pool with the same name in the same project; multiple clusters sharing one OpenStack project and identical LB names.","solutions":["List pools (`openstack loadbalancer pool list`) and delete or rename the duplicate pool sharing the name","Prefer sharing one OpenStack project per cluster so names cannot collide across clusters","Set the pool ID explicitly in the task spec so the filter resolves to a unique pool","Re-run the kops update after cleanup; Find will then match exactly one pool"],"exampleFix":"// before: two pools named 'api-pool' in one project\nopenstack loadbalancer pool delete <stale-pool-id>\n// after: only one pool with the desired name remains","handlingStrategy":"validation","validationCode":"// detect ambiguity before Find\ncmd := exec.Command(\"openstack\", \"loadbalancer\", \"pool\", \"list\", \"--name\", poolName)\nout, _ := cmd.Output()\ncount := bytes.Count(out, []byte(\"\\n\"))\nif count > 1 { return fmt.Errorf(\"duplicate pool %s exists; delete the stale one first\", poolName) }","typeGuard":"func uniquePools(rs []v2pools.Pool) (*v2pools.Pool, error) {\n\tswitch len(rs) {\n\tcase 0:\n\t\treturn nil, nil\n\tcase 1:\n\t\treturn &rs[0], nil\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"found %d pools with same name\", len(rs))\n\t}\n}","tryCatchPattern":"actual, err := task.Find(ctx)\nif err != nil && strings.Contains(err.Error(), \"found multiple pools\") {\n\t// list and delete duplicates, then retry reconcile\n}","preventionTips":["Run one kops cluster per OpenStack project","Never manually create pools with names kops manages","Clean up resources after aborted updates before retrying"],"tags":["openstack","octavia","loadbalancer","duplicate-resource"],"backgroundTag":"duplicate-resource-name","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"}