kubernetes/kops · error

Found multiple security groups with the same name: %v

Error message

Found multiple security groups with the same name: %v

What it means

While harvesting existing OpenStack security-group rules, the Neutron list query for a single named SG returned more than one result. OpenStack permits duplicate SG names across projects, so this guard fires when the lookup is ambiguous rather than when kOps created duplicates.

Source

Thrown at pkg/model/openstackmodel/firewall.go:617

func (b *FirewallModelBuilder) getExistingRules(sgMap map[string]*openstacktasks.SecurityGroup) error {
	osCloud, err := b.createCloud()
	if err != nil {
		return err
	}
	sgIdMap := make(map[string]*openstacktasks.SecurityGroup)
	for sgName, sgt := range sgMap {

		sgs, err := osCloud.ListSecurityGroups(sg.ListOpts{
			Name: sgName,
		})
		if err != nil {
			return err
		}
		if len(sgs) == 0 {
			continue
		}
		if len(sgs) > 1 {
			return fmt.Errorf("Found multiple security groups with the same name: %v", sgName)
		}
		sg := sgs[0]
		sgt.Name = new(sg.Name)
		sgIdMap[sg.ID] = sgt
	}

	for sgid := range sgIdMap {

		sgRules, err := osCloud.ListSecurityGroupRules(rules.ListOpts{
			SecGroupID: sgid,
		})
		if err != nil {
			return err
		}
		for _, rule := range sgRules {

			t := &openstacktasks.SecurityGroupRule{
				ID:             new(rule.ID),

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Disambiguate the environment by removing/renaming the duplicate security group in OpenStack
  2. Ensure OpenStack credentials/ project scope match the project where kOps created its security groups
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at pkg/model/openstackmodel/firewall.go:617 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/2ea86d0ebe99552c. Report an issue: GitHub.