kubernetes/kops · error

error updating port %s deviceid: %v

Error message

error updating port %s deviceid: %v

What it means

While recovering from the OpenStack stale-port bug (port attached to a deleted instance), updating the port's DeviceID to empty failed. The server create cannot proceed until the port is freed, so this error aborts the retry loop with the raw Neutron update error.

Source

Thrown at upup/pkg/fi/cloudup/openstack/instance.go:119

	done, err := vfs.RetryWithBackoff(writeBackoff, func() (bool, error) {

		v, err := servers.Create(context.TODO(), c.ComputeClient(), opt, schedulerHints).Extract()
		if err != nil {
			if IsPortInUse(err) && portID != "" {
				port, err := c.GetPort(portID)
				if err != nil {
					return false, fmt.Errorf("error finding port %s: %v", portID, err)
				}
				// port is attached to deleted instance, we need reset the status of the DeviceID
				// this is bug in OpenStack APIs
				if port.DeviceID != "" && port.DeviceOwner == "" {
					klog.Warningf("Port %s is attached to Device that does not exist anymore, reseting the status of DeviceID", portID)
					_, err := c.UpdatePort(portID, ports.UpdateOpts{
						DeviceID: new(""),
					})
					if err != nil {
						return false, fmt.Errorf("error updating port %s deviceid: %v", portID, err)
					}
				}
			}
			return false, fmt.Errorf("error creating server %v: %v", opt, err)
		}
		server = v

		err = waitForStatusActive(c, server.ID, nil)
		if err != nil {
			return true, err
		}

		return true, nil
	})
	if err != nil {
		return server, err
	} else if done {
		return server, nil

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Retry — the update is wrapped in retry-with-backoff and transient Neutron errors may clear
  2. Check port state and manually clear device_owner/device_id if stuck
  3. Verify the networking service policy allows port updates
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at upup/pkg/fi/cloudup/openstack/instance.go:119 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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