kubernetes/kops · error

failed to find floating ip: %v

Error message

failed to find floating ip: %v

What it means

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.

Source

Thrown at upup/pkg/fi/cloudup/openstacktasks/floatingip.go:143

	}
	return deps
}

var _ fi.CompareWithID = (*FloatingIP)(nil)

func (e *FloatingIP) CompareWithID() *string {
	return e.ID
}

func (e *FloatingIP) Find(c *fi.CloudupContext) (*FloatingIP, error) {
	if e == nil {
		return nil, nil
	}
	cloud := c.T.Cloud.(openstack.OpenstackCloud)
	if e.LB != nil && e.LB.PortID != nil {
		fip, err := findFipByPortID(cloud, fi.ValueOf(e.LB.PortID))
		if err != nil {
			return nil, fmt.Errorf("failed to find floating ip: %v", err)
		}
		if fip == nil {
			return nil, nil
		}
		actual := &FloatingIP{
			Name:      new(fip.Description),
			ID:        new(fip.ID),
			LB:        e.LB,
			Lifecycle: e.Lifecycle,
		}
		e.ID = actual.ID
		return actual, nil
	}
	fipname := fi.ValueOf(e.Name)
	fips, err := cloud.ListL3FloatingIPs(l3floatingip.ListOpts{
		Description: fipname,
	})
	if err != nil {

View on GitHub (pinned to 4c8573c808)

Solutions

  1. 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.
  2. Use `openstack floating ip list --port <port-id>` to audit and clean duplicates.
  3. For auth/API errors, refresh credentials and confirm Neutron is healthy, then rerun kops.

Example fix

// before
openstack floating ip set --port <lb-port-id> <extra-fip-id>  # creates duplicate
// after: keep exactly one FIP per port
openstack floating ip unset --port <extra-fip-id>
Defensive patterns

Strategy: try-catch

Validate before calling

// detect duplicate FIPs on the LB port before running Find
fips, _ := cloud.ListL3FloatingIPs(l3floatingip.ListOpts{PortID: portID})
if len(fips) > 1 {
    return fmt.Errorf("clean up %d duplicate FIPs on port %s", len(fips), portID)
}

Type guard

func isMultipleFIPError(err error) bool {
    return err != nil && strings.Contains(err.Error(), "multiple floating ips associated to port")
}

Try / catch

actual, err := e.Find(ctx)
if err != nil {
    if isMultipleFIPError(err) {
        // surface operator action: remove duplicate FIP on the port
    }
    return nil, err
}

Prevention

When it happens

Trigger: cloud.ListL3FloatingIPs(PortID: ...) returns an API error, or more than one floating IP is bound to the LB port — both are rewrapped here.

Common situations: 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.

Related errors


AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05). Data as JSON: /api/errors/7965aa6d4ab3f970. Report an issue: GitHub.