{"record":{"id":"f3375545e3a3eb2f","repo":"kubernetes/kops","slug":"found-multiple-securitygrouprules","errorCode":null,"errorMessage":"found multiple SecurityGroupRules","messagePattern":"found multiple SecurityGroupRules","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/openstacktasks/securitygrouprule.go","lineNumber":99,"sourceCode":"\t\tEtherType:      fi.ValueOf(r.EtherType),\n\t\tPortRangeMax:   IntValue(r.PortRangeMax),\n\t\tPortRangeMin:   IntValue(r.PortRangeMin),\n\t\tProtocol:       fi.ValueOf(r.Protocol),\n\t\tRemoteIPPrefix: fi.ValueOf(r.RemoteIPPrefix),\n\t\tSecGroupID:     fi.ValueOf(r.SecGroup.ID),\n\t}\n\tif r.RemoteGroup != nil {\n\t\topt.RemoteGroupID = fi.ValueOf(r.RemoteGroup.ID)\n\t}\n\trs, err := cloud.ListSecurityGroupRules(opt)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tn := len(rs)\n\tif n == 0 {\n\t\treturn nil, nil\n\t} else if n != 1 {\n\t\treturn nil, fmt.Errorf(\"found multiple SecurityGroupRules\")\n\t}\n\trule := rs[0]\n\tactual := &SecurityGroupRule{\n\t\tID:             new(rule.ID),\n\t\tDirection:      new(rule.Direction),\n\t\tEtherType:      new(rule.EtherType),\n\t\tPortRangeMax:   Int(rule.PortRangeMax),\n\t\tPortRangeMin:   Int(rule.PortRangeMin),\n\t\tProtocol:       new(rule.Protocol),\n\t\tRemoteIPPrefix: new(rule.RemoteIPPrefix),\n\t\tRemoteGroup:    r.RemoteGroup,\n\t\tSecGroup:       r.SecGroup,\n\t\tLifecycle:      r.Lifecycle,\n\t\tDelete:         new(false),\n\t}\n\n\tr.ID = actual.ID\n\treturn actual, nil","sourceCodeStart":81,"sourceCodeEnd":117,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/openstacktasks/securitygrouprule.go#L81-L117","documentation":"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.","triggerScenarios":"Thrown at upup/pkg/fi/cloudup/openstacktasks/securitygrouprule.go:99 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["List rules on the security group and remove redundant duplicates","Re-run discovery once the rule tuple is unique"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T12:17:11.808Z"}