{"record":{"id":"cb2991bcf55fb1d9","repo":"kubernetes/kops","slug":"found-multiple-routetables-matching-tags-cb2991","errorCode":null,"errorMessage":"found multiple RouteTables matching tags","messagePattern":"found multiple RouteTables matching tags","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/awstasks/routetableassociation.go","lineNumber":71,"sourceCode":"\n\tif routeTableID == nil || subnetID == nil {\n\t\treturn nil, nil\n\t}\n\n\trequest := &ec2.DescribeRouteTablesInput{\n\t\tRouteTableIds: []string{fi.ValueOf(routeTableID)},\n\t}\n\n\tresponse, err := cloud.EC2().DescribeRouteTables(ctx, request)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error listing RouteTables: %v\", err)\n\t}\n\tif response == nil || len(response.RouteTables) == 0 {\n\t\treturn nil, nil\n\t}\n\n\tif len(response.RouteTables) != 1 {\n\t\treturn nil, fmt.Errorf(\"found multiple RouteTables matching tags\")\n\t}\n\trt := response.RouteTables[0]\n\tfor _, rta := range rt.Associations {\n\t\tif aws.ToString(rta.SubnetId) != *subnetID {\n\t\t\tcontinue\n\t\t}\n\t\tactual := &RouteTableAssociation{\n\t\t\tName:       e.Name,\n\t\t\tID:         rta.RouteTableAssociationId,\n\t\t\tRouteTable: &RouteTable{ID: rta.RouteTableId},\n\t\t\tSubnet:     &Subnet{ID: rta.SubnetId},\n\t\t}\n\t\tklog.V(2).Infof(\"found matching RouteTableAssociation %q\", *actual.ID)\n\t\te.ID = actual.ID\n\n\t\t// Prevent spurious changes\n\t\tactual.Lifecycle = e.Lifecycle\n","sourceCodeStart":53,"sourceCodeEnd":89,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/awstasks/routetableassociation.go#L53-L89","documentation":"When looking up a route table by ID within RouteTableAssociation.Find, kOps expects exactly one result; more than one is impossible for an ID lookup but treated as an ambiguity and fails fast. (The 'matching tags' wording is inherited from the by-filters helper and is slightly misleading here.)","triggerScenarios":"len(response.RouteTables) > 1 from an ID-scoped DescribeRouteTables — only via anomalous API behavior or a test/mocked EC2 client returning multiple tables.","commonSituations":"Unit tests with fake clients; AWS API anomalies. Practically unobservable in real clusters.","solutions":["Re-run; if persistent, capture the raw DescribeRouteTables response for AWS support","Check for a misconfigured custom EC2 endpoint or mock/proxy in the environment","File/report a kOps issue if reproducible with a real AWS endpoint"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"rt, err := findRouteTable(ctx, cloud, id, subnetID)\nif err != nil && strings.Contains(err.Error(), \"found multiple RouteTables\") {\n  return fmt.Errorf(\"ambiguous route table data for %s; investigate AWS response\", id)\n}","preventionTips":["Run against real AWS endpoints in production","If seen repeatedly, capture the raw response and report to AWS/kOps"],"tags":["aws","ec2","routetableassociation","invariant"],"backgroundTag":"ambiguous-resource-lookup","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"}