{"record":{"id":"4517c797d2fe481f","repo":"kubernetes/kops","slug":"error-listing-routetables-v-4517c7","errorCode":null,"errorMessage":"error listing RouteTables: %v","messagePattern":"error listing RouteTables: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/awstasks/routetable.go","lineNumber":119,"sourceCode":"\t\tTags: intersectTags(rt.Tags, e.Tags),\n\t}\n\tklog.V(2).Infof(\"found matching RouteTable %q\", *actual.ID)\n\te.ID = actual.ID\n\n\t// Prevent spurious changes\n\tactual.Lifecycle = e.Lifecycle\n\tactual.Shared = e.Shared\n\n\treturn actual, nil\n}\n\nfunc findRouteTableByID(ctx context.Context, cloud awsup.AWSCloud, id string) (*ec2types.RouteTable, error) {\n\trequest := &ec2.DescribeRouteTablesInput{}\n\trequest.RouteTableIds = []string{id}\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 ID\")\n\t}\n\trt := response.RouteTables[0]\n\n\treturn &rt, nil\n}\n\nfunc findRouteTableByFilters(ctx context.Context, cloud awsup.AWSCloud, filters []ec2types.Filter) (*ec2types.RouteTable, error) {\n\trequest := &ec2.DescribeRouteTablesInput{}\n\trequest.Filters = filters\n\n\tresponse, err := cloud.EC2().DescribeRouteTables(ctx, request)","sourceCodeStart":101,"sourceCodeEnd":137,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/awstasks/routetable.go#L101-L137","documentation":"findRouteTableByID calls EC2 DescribeRouteTables with a specific route table ID and wraps any AWS API error. This means the DescribeRouteTables call itself failed (network, credentials, throttling, or invalid ID format), not that the table was absent — absence returns nil, nil.","triggerScenarios":"DescribeRouteTables returns an error: invalid route table ID format (InvalidRouteTableId.NotFound or Malformed), expired/insufficient IAM credentials, throttling, or network failure during findNatGatewayFromRouteTable or RouteTable.Find.","commonSituations":"Route table deleted outside kOps between spec and reconcile; stale nodeup/cluster state referencing a removed table; AWS throttling during large reconciliations; IAM policy lacking ec2:DescribeRouteTables.","solutions":["Re-run the reconcile — many AWS failures are transient","Verify the route table ID still exists: `aws ec2 describe-route-tables --route-table-ids <id>`","Check IAM permissions include ec2:DescribeRouteTables","Look at the wrapped %v AWS error for the specific code (throttling vs not-found) and act accordingly"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// pre-check via AWS CLI\naws ec2 describe-route-tables --route-table-ids rtb-123 || echo \"missing\"\n","typeGuard":null,"tryCatchPattern":"rt, err := findRouteTableByID(ctx, cloud, id)\nvar aerr smithy.APIError\nif errors.As(err, &aerr) && aerr.ErrorCode() == \"RequestLimitExceeded\" {\n  backoffAndRetry()\n} else if err != nil { return err }","preventionTips":["Grant ec2:DescribeRouteTables to the kOps IAM role","Don't delete route tables out-of-band while a cluster manages them","Set AWS SDK retry limits appropriately for large reconciles"],"tags":["aws","ec2","routetable","api-error"],"backgroundTag":"aws-api-request-failed","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"}