kubernetes/kops · error

found multiple SecurityGroupRules

Error message

found multiple SecurityGroupRules

What it means

Listing security-group rules with the task's exact filter tuple returned more than one rule. The filter is expected to be unique; duplicates mean the cloud has redundant identical rules, so it is ambiguous which one the task models.

Solutions

  1. List rules on the security group and remove redundant duplicates
  2. Re-run discovery once the rule tuple is unique
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at upup/pkg/fi/cloudup/openstacktasks/securitygrouprule.go:99 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/f3375545e3a3eb2f. Report an issue: GitHub.

Appendix: source

Thrown at upup/pkg/fi/cloudup/openstacktasks/securitygrouprule.go:99

		EtherType:      fi.ValueOf(r.EtherType),
		PortRangeMax:   IntValue(r.PortRangeMax),
		PortRangeMin:   IntValue(r.PortRangeMin),
		Protocol:       fi.ValueOf(r.Protocol),
		RemoteIPPrefix: fi.ValueOf(r.RemoteIPPrefix),
		SecGroupID:     fi.ValueOf(r.SecGroup.ID),
	}
	if r.RemoteGroup != nil {
		opt.RemoteGroupID = fi.ValueOf(r.RemoteGroup.ID)
	}
	rs, err := cloud.ListSecurityGroupRules(opt)
	if err != nil {
		return nil, err
	}
	n := len(rs)
	if n == 0 {
		return nil, nil
	} else if n != 1 {
		return nil, fmt.Errorf("found multiple SecurityGroupRules")
	}
	rule := rs[0]
	actual := &SecurityGroupRule{
		ID:             new(rule.ID),
		Direction:      new(rule.Direction),
		EtherType:      new(rule.EtherType),
		PortRangeMax:   Int(rule.PortRangeMax),
		PortRangeMin:   Int(rule.PortRangeMin),
		Protocol:       new(rule.Protocol),
		RemoteIPPrefix: new(rule.RemoteIPPrefix),
		RemoteGroup:    r.RemoteGroup,
		SecGroup:       r.SecGroup,
		Lifecycle:      r.Lifecycle,
		Delete:         new(false),
	}

	r.ID = actual.ID
	return actual, nil

View on GitHub (pinned to 4c8573c808)