{"record":{"id":"2ea86d0ebe99552c","repo":"kubernetes/kops","slug":"found-multiple-security-groups-with-the-same-name","errorCode":null,"errorMessage":"Found multiple security groups with the same name: %v","messagePattern":"Found multiple security groups with the same name: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/model/openstackmodel/firewall.go","lineNumber":617,"sourceCode":"func (b *FirewallModelBuilder) getExistingRules(sgMap map[string]*openstacktasks.SecurityGroup) error {\n\tosCloud, err := b.createCloud()\n\tif err != nil {\n\t\treturn err\n\t}\n\tsgIdMap := make(map[string]*openstacktasks.SecurityGroup)\n\tfor sgName, sgt := range sgMap {\n\n\t\tsgs, err := osCloud.ListSecurityGroups(sg.ListOpts{\n\t\t\tName: sgName,\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif len(sgs) == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif len(sgs) > 1 {\n\t\t\treturn fmt.Errorf(\"Found multiple security groups with the same name: %v\", sgName)\n\t\t}\n\t\tsg := sgs[0]\n\t\tsgt.Name = new(sg.Name)\n\t\tsgIdMap[sg.ID] = sgt\n\t}\n\n\tfor sgid := range sgIdMap {\n\n\t\tsgRules, err := osCloud.ListSecurityGroupRules(rules.ListOpts{\n\t\t\tSecGroupID: sgid,\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tfor _, rule := range sgRules {\n\n\t\t\tt := &openstacktasks.SecurityGroupRule{\n\t\t\t\tID:             new(rule.ID),","sourceCodeStart":599,"sourceCodeEnd":635,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/pkg/model/openstackmodel/firewall.go#L599-L635","documentation":"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.","triggerScenarios":"Thrown at pkg/model/openstackmodel/firewall.go:617 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Disambiguate the environment by removing/renaming the duplicate security group in OpenStack","Ensure OpenStack credentials/ project scope match the project where kOps created its security groups"],"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-12T07:17:12.445Z"}