kubernetes/kops · error

failed to list layer 3 floating ips for port ID %s: %v

Error message

failed to list layer 3 floating ips for port ID %s: %v

What it means

findFipByPortID in floatingip.go:187 wraps an error from cloud.ListL3FloatingIPs(PortID: id) while resolving the floating IP bound to a given Neutron port. Called from FloatingIP.Find, it means the API-level list by port ID failed — not that the port has zero FIPs (that returns nil,nil).

Source

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

				Name:      e.Name,
				IP:        new(fip.FloatingIP),
				Lifecycle: e.Lifecycle,
			}
			e.ID = actual.ID
			e.IP = actual.IP
			return actual, nil
		}
	}

	return nil, nil
}

func findFipByPortID(cloud openstack.OpenstackCloud, id string) (fip *l3floatingip.FloatingIP, err error) {
	fips, err := cloud.ListL3FloatingIPs(l3floatingip.ListOpts{
		PortID: id,
	})
	if err != nil {
		return nil, fmt.Errorf("failed to list layer 3 floating ips for port ID %s: %v", id, err)
	}
	if len(fips) == 0 {
		return nil, nil
	}
	if len(fips) > 1 {
		return nil, fmt.Errorf("multiple floating ips associated to port: %s", id)
	}
	return &fips[0], nil
}

func (e *FloatingIP) Run(c *fi.CloudupContext) error {
	return fi.CloudupDefaultDeltaRunMethod(e, c)
}

func (_ *FloatingIP) CheckChanges(a, e, changes *FloatingIP) error {
	if a == nil {
		if e.Name == nil {
			return fi.RequiredField("Name")

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Inspect the wrapped error's HTTP code and fix accordingly (re-auth for 401, permissions for 403).
  2. Confirm connectivity to the Neutron public endpoint (`openstack floating ip list`).
  3. Retry the kops command if the failure was a transient 5xx.
  4. Ensure the port ID exists: `openstack port show <id>`; a deleted port can surface as odd API behavior.
Defensive patterns

Strategy: retry

Validate before calling

// preflight: ensure the port exists and Neutron list API is healthy
if _, err := cloud.ListL3FloatingIPs(l3floatingip.ListOpts{PortID: portID, Limit: 1}); err != nil {
    return fmt.Errorf("preflight FIP list failed: %w", err)
}

Type guard

func isRetryableNeutronError(err error) bool {
    var gerr gophercloud.ErrUnexpectedResponseCode
    return errors.As(err, &gerr) && gerr.Actual >= 500
}

Try / catch

fip, err := findFipByPortID(cloud, portID)
if err != nil {
    if isRetryableNeutronError(err) {
        // back off and retry the whole kops step
    }
    return nil, err
}

Prevention

When it happens

Trigger: Neutron returns 401/403/404/5xx for the floatingips list filtered by port_id, or a network connectivity failure to the Neutron endpoint.

Common situations: Expired credentials mid-run; Neutron endpoint unreachable from the machine running kops (VPN/proxy/DNS issues); OpenStack cloud with restricted list policies.

Related errors


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