kubernetes/kops · error

found multiple ports with name: %s

Error message

found multiple ports with name: %s

What it means

Port.Find is the cloud-discovery half of the Port task: it looks up an existing Neutron port by name and expects exactly one match. If the Neutron ports list returns more than one port with the requested name, Find refuses to guess and returns this error so reconciliation fails deterministically instead of mutating the wrong port.

Source

Thrown at upup/pkg/fi/cloudup/openstacktasks/port.go:218

		actual.AdditionalSecurityGroups = find.AdditionalSecurityGroups
		actual.WellKnownServices = find.WellKnownServices
	}
	return actual, nil
}

func (s *Port) Find(context *fi.CloudupContext) (*Port, error) {
	cloud := context.T.Cloud.(openstack.OpenstackCloud)
	opt := ports.ListOpts{
		Name: fi.ValueOf(s.Name),
	}
	rs, err := cloud.ListPorts(opt)
	if err != nil {
		return nil, err
	}
	if rs == nil {
		return nil, nil
	} else if len(rs) != 1 {
		return nil, fmt.Errorf("found multiple ports with name: %s", fi.ValueOf(s.Name))
	}

	// sort for consistent comparison
	sort.Sort(SecurityGroupsByID(s.SecurityGroups))

	return newPortTaskFromCloud(cloud, s.Lifecycle, &rs[0], s)
}

func (s *Port) Run(context *fi.CloudupContext) error {
	return fi.CloudupDefaultDeltaRunMethod(s, context)
}

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

View on GitHub (pinned to 4c8573c808)

Solutions

  1. List Neutron ports in the project (openstack port list --name <name>) and delete the stale duplicate
  2. Re-run kops after only one port with that name remains
  3. If duplicates are from an aborted run, remove all leftover load-balancer/networking resources and re-create
  4. Rename the manually created port so it no longer collides

Example fix

null
Defensive patterns

Strategy: validation

Validate before calling

ports, err := cloud.ListPorts(listOpts{Name: portName})
if err != nil { return err }
if len(ports) > 1 {
    return fmt.Errorf("found multiple ports with name: %s — delete duplicates first", portName)
}

Try / catch

if err := task.Find(cloud); err != nil {
    if strings.Contains(err.Error(), "found multiple ports") {
        // remediate: list & delete duplicate ports, then retry
    }
}

Prevention

When it happens

Trigger: Two or more Neutron ports share the same name in the project when the Port task runs Find during cluster reconciliation (listPorts filtered by name returns len(rs) > 1).

Common situations: A previous failed/aborted kops run left a duplicate port behind; another tool or user manually created a port with the same name; ports created in a different availability zone reused a clashing name.

Related errors


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