{"record":{"id":"6f8bc932dff3a609","repo":"kubernetes/kops","slug":"error-listing-routetables-v-6f8bc9","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/route.go","lineNumber":71,"sourceCode":"\tctx := c.Context()\n\tcloud := awsup.GetCloud(c)\n\n\tif e.RouteTable == nil || (e.CIDR == nil && e.IPv6CIDR == nil) {\n\t\t// TODO: Move to validate?\n\t\treturn nil, nil\n\t}\n\n\tif e.RouteTable.ID == nil {\n\t\treturn nil, nil\n\t}\n\n\trequest := &ec2.DescribeRouteTablesInput{\n\t\tRouteTableIds: []string{fi.ValueOf(e.RouteTable.ID)},\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} else {\n\t\tif len(response.RouteTables) != 1 {\n\t\t\tklog.Fatalf(\"found multiple RouteTables matching tags\")\n\t\t}\n\t\trt := response.RouteTables[0]\n\t\tfor _, r := range rt.Routes {\n\t\t\tif (r.DestinationCidrBlock == nil || aws.ToString(r.DestinationCidrBlock) != aws.ToString(e.CIDR)) &&\n\t\t\t\t(r.DestinationIpv6CidrBlock == nil || aws.ToString(r.DestinationIpv6CidrBlock) != aws.ToString(e.IPv6CIDR)) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tactual := &Route{\n\t\t\t\tName:       e.Name,\n\t\t\t\tRouteTable: &RouteTable{ID: rt.RouteTableId},\n\t\t\t\tCIDR:       r.DestinationCidrBlock,\n\t\t\t\tIPv6CIDR:   r.DestinationIpv6CidrBlock,","sourceCodeStart":53,"sourceCodeEnd":89,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/awstasks/route.go#L53-L89","documentation":"This error occurs when the EC2 DescribeRouteTables API call fails while kOps tries to look up an existing RouteTable by ID during a Route task's Find operation. The route table ID may be wrong, the table deleted, or IAM permissions insufficient. It wraps the raw AWS error with %v for context.","triggerScenarios":"DescribeRouteTables returning an error: invalid RouteTableId, route table deleted out-of-band, IAM policy denying ec2:DescribeRouteTables, throttling, or network failure to the AWS endpoint.","commonSituations":"Route tables deleted manually in the AWS console while the kOps cluster spec still references them; IAM roles missing EC2 describe permissions; AWS API rate-limiting during large cluster operations.","solutions":["Verify the RouteTable ID in the error still exists in the AWS console/CLI","Check IAM permissions include ec2:DescribeRouteTables","Retry if the error is throttling-related (RequestLimitExceeded)","Re-run kops update cluster after any out-of-band AWS changes"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Pre-verify route table exists before running kops update\naws ec2 describe-route-tables --route-table-ids rtb-0abc123 --region us-east-1","typeGuard":null,"tryCatchPattern":"tables, err := cloud.EC2().DescribeRouteTables(ctx, req)\nif err != nil {\n    var rerr *types.RequestLimitExceeded\n    if errors.As(err, &rerr) { /* back off and retry */ }\n    var nf *awserr.RequestFailure\n    if errors.As(err, &nf) && nf.StatusCode() == 403 { /* fix IAM */ }\n    return nil, fmt.Errorf(\"error listing RouteTables: %v\", err)\n}","preventionTips":["Avoid deleting route tables manually while a kOps cluster references them","Ensure ec2:DescribeRouteTables is in the kOps IAM policy","Back off on RequestLimitExceeded throttling errors"],"tags":["aws","ec2","route-table","api-error"],"backgroundTag":"aws-api-call-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"}