{"record":{"id":"b26f9e4b0227bd6f","repo":"kubernetes/kops","slug":"found-multiple-eventbridge-rules-with-the-same-nam","errorCode":null,"errorMessage":"found multiple EventBridge rules with the same name %s","messagePattern":"found multiple EventBridge rules with the same name (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/model/awsmodel/nodeterminationhandler.go","lineNumber":211,"sourceCode":"\t}\n\n\tclusterName := b.ClusterName()\n\tclusterNamePrefix := awsup.GetClusterName40(clusterName)\n\truleName := aws.String(clusterNamePrefix + \"-\" + rebalanceEvent.name)\n\n\teventBridge := cloud.(awsup.AWSCloud).EventBridge()\n\trequest := &eventbridge.ListRulesInput{\n\t\tNamePrefix: ruleName,\n\t}\n\tresponse, err := eventBridge.ListRules(c.Context(), request)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"listing EventBridge rules: %w\", err)\n\t}\n\tif response == nil || len(response.Rules) == 0 {\n\t\treturn nil\n\t}\n\tif len(response.Rules) > 1 {\n\t\treturn fmt.Errorf(\"found multiple EventBridge rules with the same name %s\", *ruleName)\n\t}\n\n\trule := response.Rules[0]\n\n\ttagResponse, err := eventBridge.ListTagsForResource(c.Context(), &eventbridge.ListTagsForResourceInput{ResourceARN: rule.Arn})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"listing tags for EventBridge rule: %w\", err)\n\t}\n\n\towned := false\n\townershipTag := \"kubernetes.io/cluster/\" + b.Cluster.ObjectMeta.Name\n\tfor _, tag := range tagResponse.Tags {\n\t\tif fi.ValueOf(tag.Key) == ownershipTag && fi.ValueOf(tag.Value) == \"owned\" {\n\t\t\towned = true\n\t\t\tbreak\n\t\t}\n\t}\n\tif !owned {","sourceCodeStart":193,"sourceCodeEnd":229,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/pkg/model/awsmodel/nodeterminationhandler.go#L193-L229","documentation":"ListRules returned more than one rule matching the kOps cluster-name prefix; kOps expects a uniquely named rule and cannot decide which one to delete.","triggerScenarios":"Thrown at pkg/model/awsmodel/nodeterminationhandler.go:211 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the duplicate EventBridge rules in the console and remove the stale one","Ensure no other tool creates rules with the same cluster-name prefix","Re-run the operation"],"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"}