{"record":{"id":"79f1dedd38655992","repo":"kubernetes/kops","slug":"multiple-floating-ips-associated-to-port-s","errorCode":null,"errorMessage":"multiple floating ips associated to port: %s","messagePattern":"multiple floating ips associated to port: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/openstacktasks/floatingip.go","lineNumber":193,"sourceCode":"\t\t\treturn actual, nil\n\t\t}\n\t}\n\n\treturn nil, nil\n}\n\nfunc findFipByPortID(cloud openstack.OpenstackCloud, id string) (fip *l3floatingip.FloatingIP, err error) {\n\tfips, err := cloud.ListL3FloatingIPs(l3floatingip.ListOpts{\n\t\tPortID: id,\n\t})\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to list layer 3 floating ips for port ID %s: %v\", id, err)\n\t}\n\tif len(fips) == 0 {\n\t\treturn nil, nil\n\t}\n\tif len(fips) > 1 {\n\t\treturn nil, fmt.Errorf(\"multiple floating ips associated to port: %s\", id)\n\t}\n\treturn &fips[0], nil\n}\n\nfunc (e *FloatingIP) Run(c *fi.CloudupContext) error {\n\treturn fi.CloudupDefaultDeltaRunMethod(e, c)\n}\n\nfunc (_ *FloatingIP) CheckChanges(a, e, changes *FloatingIP) 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}\n\t\tif changes.Name != nil && fi.ValueOf(a.Name) != \"\" {","sourceCodeStart":175,"sourceCodeEnd":211,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/openstacktasks/floatingip.go#L175-L211","documentation":"findFipByPortID in floatingip.go:193 refuses to pick a floating IP when more than one l3 floating IP is associated with the same Neutron port, since the task cannot determine which one is managed by kops. It is a state-drift guard, not an API failure.","triggerScenarios":"Two or more entries returned by ListL3FloatingIPs with PortID == the LB port — e.g. a FIP was created manually in addition to the kops-managed one, or a previous partially-failed kops run left a duplicate.","commonSituations":"Manual operator intervention adding FIPs; a prior kops run crashed after creating a FIP but before recording it, then re-created one; shared cluster where multiple tooling (e.g. cloud provider LB controller and kops) both allocate FIPs.","solutions":["List the FIPs on the port: `openstack floating ip list --port <port-id>` and disassociate/delete all but the intended one.","Prefer deleting the FIP whose Description does not match the kops task name.","Rerun `kops update cluster` after cleanup so reconciliation sees a single FIP.","Going forward, avoid manually assigning floating IPs to ports managed by kops."],"exampleFix":"// before: two FIPs on one port\nopenstack floating ip list --port <lb-port-id>   # shows 2 rows\n// after\nopenstack floating ip unset --port <duplicate-fip-id>\nopenstack floating ip delete <duplicate-fip-id>","handlingStrategy":"validation","validationCode":"// fail early with a clear message if the port has more than one FIP\nfips, _ := cloud.ListL3FloatingIPs(l3floatingip.ListOpts{PortID: portID})\nif len(fips) > 1 {\n    return fmt.Errorf(\"port %s has %d floating IPs; delete extras before update\", portID, len(fips))\n}","typeGuard":"func hasSingleFIP(fips []l3floatingip.FloatingIP) bool {\n    return len(fips) <= 1\n}","tryCatchPattern":"fip, err := findFipByPortID(cloud, portID)\nif err != nil && strings.Contains(err.Error(), \"multiple floating ips\") {\n    // operator cleanup required: disassociate/delete duplicate FIPs\n    return nil, err\n}","preventionTips":["Never create FIPs manually on kops-managed LB ports","After a crashed kops run, check for and remove duplicate FIPs","Tag/inspect FIP descriptions to identify non-kops allocations","Run `openstack floating ip list --port <id>` as a pre-update audit"],"tags":["openstack","neutron","floating-ip","duplicate","state-drift"],"backgroundTag":"multiple-floating-ips-on-port","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"}