kubernetes/kops · error

found multiple subnets with name: %s

Error message

found multiple subnets with name: %s

What it means

Listing subnets with the task's filter tuple (ID/name/network/CIDR, DHCP-enabled, IPv4) returned more than one subnet. The filter is expected to be unique; duplicates make it ambiguous which subnet the task models.

Source

Thrown at upup/pkg/fi/cloudup/openstacktasks/subnet.go:110

func (s *Subnet) Find(context *fi.CloudupContext) (*Subnet, error) {
	cloud := context.T.Cloud.(openstack.OpenstackCloud)
	opt := subnets.ListOpts{
		ID:         fi.ValueOf(s.ID),
		Name:       fi.ValueOf(s.Name),
		NetworkID:  fi.ValueOf(s.Network.ID),
		CIDR:       fi.ValueOf(s.CIDR),
		EnableDHCP: new(true),
		IPVersion:  4,
	}
	rs, err := cloud.ListSubnets(opt)
	if err != nil {
		return nil, err
	}
	if rs == nil {
		return nil, nil
	} else if len(rs) != 1 {
		return nil, fmt.Errorf("found multiple subnets with name: %s", fi.ValueOf(s.Name))
	}
	return NewSubnetTaskFromCloud(cloud, s.Lifecycle, &rs[0], s)
}

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

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

View on GitHub (pinned to 4c8573c808)

Solutions

  1. List subnets with the same filters and de-duplicate
  2. Rename or delete the colliding subnet
  3. Re-run discovery once the match is unique
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at upup/pkg/fi/cloudup/openstacktasks/subnet.go:110 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/1d960b3e1e39a046. Report an issue: GitHub.