{"record":{"id":"7965aa6d4ab3f970","repo":"kubernetes/kops","slug":"failed-to-find-floating-ip-v","errorCode":null,"errorMessage":"failed to find floating ip: %v","messagePattern":"failed to find floating ip: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/openstacktasks/floatingip.go","lineNumber":143,"sourceCode":"\t}\n\treturn deps\n}\n\nvar _ fi.CompareWithID = (*FloatingIP)(nil)\n\nfunc (e *FloatingIP) CompareWithID() *string {\n\treturn e.ID\n}\n\nfunc (e *FloatingIP) Find(c *fi.CloudupContext) (*FloatingIP, error) {\n\tif e == nil {\n\t\treturn nil, nil\n\t}\n\tcloud := c.T.Cloud.(openstack.OpenstackCloud)\n\tif e.LB != nil && e.LB.PortID != nil {\n\t\tfip, err := findFipByPortID(cloud, fi.ValueOf(e.LB.PortID))\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to find floating ip: %v\", err)\n\t\t}\n\t\tif fip == nil {\n\t\t\treturn nil, nil\n\t\t}\n\t\tactual := &FloatingIP{\n\t\t\tName:      new(fip.Description),\n\t\t\tID:        new(fip.ID),\n\t\t\tLB:        e.LB,\n\t\t\tLifecycle: e.Lifecycle,\n\t\t}\n\t\te.ID = actual.ID\n\t\treturn actual, nil\n\t}\n\tfipname := fi.ValueOf(e.Name)\n\tfips, err := cloud.ListL3FloatingIPs(l3floatingip.ListOpts{\n\t\tDescription: fipname,\n\t})\n\tif err != nil {","sourceCodeStart":125,"sourceCodeEnd":161,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/openstacktasks/floatingip.go#L125-L161","documentation":"Find in floatingip.go:143 wraps a failure from findFipByPortID (which itself may be the list failure or the multiple-FIP error) when resolving an existing FloatingIP task by the load balancer's port ID. It means the port-ID based discovery of the task's floating IP failed with a wrapped error, distinct from the not-found case which returns nil,nil.","triggerScenarios":"cloud.ListL3FloatingIPs(PortID: ...) returns an API error, or more than one floating IP is bound to the LB port — both are rewrapped here.","commonSituations":"Duplicate floating IPs manually attached to the same LB port; Neutron API errors from auth/expiry; state drift where an operator or another tool created extra FIPs on the port.","solutions":["Inspect the wrapped error: if it is 'multiple floating ips associated to port', disassociate the extra FIPs so only one remains on the LB port.","Use `openstack floating ip list --port <port-id>` to audit and clean duplicates.","For auth/API errors, refresh credentials and confirm Neutron is healthy, then rerun kops."],"exampleFix":"// before\nopenstack floating ip set --port <lb-port-id> <extra-fip-id>  # creates duplicate\n// after: keep exactly one FIP per port\nopenstack floating ip unset --port <extra-fip-id>","handlingStrategy":"try-catch","validationCode":"// detect duplicate FIPs on the LB port before running Find\nfips, _ := cloud.ListL3FloatingIPs(l3floatingip.ListOpts{PortID: portID})\nif len(fips) > 1 {\n    return fmt.Errorf(\"clean up %d duplicate FIPs on port %s\", len(fips), portID)\n}","typeGuard":"func isMultipleFIPError(err error) bool {\n    return err != nil && strings.Contains(err.Error(), \"multiple floating ips associated to port\")\n}","tryCatchPattern":"actual, err := e.Find(ctx)\nif err != nil {\n    if isMultipleFIPError(err) {\n        // surface operator action: remove duplicate FIP on the port\n    }\n    return nil, err\n}","preventionTips":["Never attach manual FIPs to ports kops manages","Audit FIP-port bindings after interrupted kops runs","Use a single tool (kops or cloud LB controller) to allocate FIPs","Reconcile state with `kops update cluster` after manual changes"],"tags":["openstack","neutron","floating-ip","port","task-reconcile"],"backgroundTag":"floating-ip-lookup-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"}