{"record":{"id":"92dff67bab0dc0ed","repo":"kubernetes/kops","slug":"multiple-listeners-found-with-name-s","errorCode":null,"errorMessage":"Multiple listeners found with name %s","messagePattern":"Multiple listeners found with name (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/openstacktasks/lblistener.go","lineNumber":119,"sourceCode":"\nfunc (s *LBListener) Find(context *fi.CloudupContext) (*LBListener, error) {\n\tif s.Name == nil {\n\t\treturn nil, nil\n\t}\n\n\tcloud := context.T.Cloud.(openstack.OpenstackCloud)\n\tlistenerList, err := cloud.ListListeners(listeners.ListOpts{\n\t\tID:   fi.ValueOf(s.ID),\n\t\tName: fi.ValueOf(s.Name),\n\t})\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"Failed to list loadbalancer listeners for name %s: %v\", fi.ValueOf(s.Name), err)\n\t}\n\tif len(listenerList) == 0 {\n\t\treturn nil, nil\n\t}\n\tif len(listenerList) > 1 {\n\t\treturn nil, fmt.Errorf(\"Multiple listeners found with name %s\", fi.ValueOf(s.Name))\n\t}\n\n\treturn NewLBListenerTaskFromCloud(cloud, s.Lifecycle, &listenerList[0], s)\n}\n\nfunc (s *LBListener) Run(context *fi.CloudupContext) error {\n\treturn fi.CloudupDefaultDeltaRunMethod(s, context)\n}\n\nfunc (_ *LBListener) CheckChanges(a, e, changes *LBListener) error {\n\tif a == nil {\n\t\tif e.Name == nil {\n\t\t\treturn fi.RequiredField(\"Name\")\n\t\t}\n\t} else {\n\t\tif changes.ID != nil {\n\t\t\treturn fi.CannotChangeField(\"ID\")\n\t\t}","sourceCodeStart":101,"sourceCodeEnd":137,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/openstacktasks/lblistener.go#L101-L137","documentation":"kOps assumes listener names are unique within the OpenStack project. When ListListeners filtered by the task's name returns more than one listener, kOps refuses to proceed because it cannot decide which listener corresponds to the cluster resource.","triggerScenarios":"Find with s.Name set where the Octavia list query (ID/Name filter) matches ≥2 listeners — duplicate listeners sharing the cluster-configured name exist in the same tenant.","commonSituations":"A previous failed `kops update cluster` left a partially created duplicate; someone manually created another listener with the same name on the same LB or a different LB; clusters reusing a name across LBs in one project.","solutions":["List and inspect duplicates: `openstack loadbalancer listener list | grep <name>`","Delete the stale/duplicate listener(s) (`openstack loadbalancer listener delete <id>`) keeping the one matching the cluster spec","Give listeners globally unique names per project in the cluster config to avoid collisions"],"exampleFix":"// before: duplicate listeners with the same name\nopenstack loadbalancer listener list  # shows two entries named 'api'\n// after: remove the stale one\nopenstack loadbalancer listener delete <stale-id>\nkops update cluster --name mycluster","handlingStrategy":"validation","validationCode":"// Ensure listener names are unique in the project before updating\ndups=$(openstack loadbalancer listener list -f value -c Name | sort | uniq -d)\n[ -z \"$dups\" ] || { echo \"duplicate listener names: $dups\"; exit 1; }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Enforce unique listener names per project in automation (Terraform/Heat) that shares the tenant","After a failed cluster update, check for and remove partial/duplicate listeners before re-running","Never create listeners manually with names used by the kops cluster spec"],"tags":["openstack","octavia","listener","duplicate-resources"],"backgroundTag":"duplicate-cloud-resource","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"}