kubernetes/kops · error

error listing RouteTables: %v

Error message

error listing RouteTables: %v

What it means

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.

Source

Thrown at upup/pkg/fi/cloudup/awstasks/route.go:71

	ctx := c.Context()
	cloud := awsup.GetCloud(c)

	if e.RouteTable == nil || (e.CIDR == nil && e.IPv6CIDR == nil) {
		// TODO: Move to validate?
		return nil, nil
	}

	if e.RouteTable.ID == nil {
		return nil, nil
	}

	request := &ec2.DescribeRouteTablesInput{
		RouteTableIds: []string{fi.ValueOf(e.RouteTable.ID)},
	}

	response, err := cloud.EC2().DescribeRouteTables(ctx, request)
	if err != nil {
		return nil, fmt.Errorf("error listing RouteTables: %v", err)
	}
	if response == nil || len(response.RouteTables) == 0 {
		return nil, nil
	} else {
		if len(response.RouteTables) != 1 {
			klog.Fatalf("found multiple RouteTables matching tags")
		}
		rt := response.RouteTables[0]
		for _, r := range rt.Routes {
			if (r.DestinationCidrBlock == nil || aws.ToString(r.DestinationCidrBlock) != aws.ToString(e.CIDR)) &&
				(r.DestinationIpv6CidrBlock == nil || aws.ToString(r.DestinationIpv6CidrBlock) != aws.ToString(e.IPv6CIDR)) {
				continue
			}
			actual := &Route{
				Name:       e.Name,
				RouteTable: &RouteTable{ID: rt.RouteTableId},
				CIDR:       r.DestinationCidrBlock,
				IPv6CIDR:   r.DestinationIpv6CidrBlock,

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Verify the RouteTable ID in the error still exists in the AWS console/CLI
  2. Check IAM permissions include ec2:DescribeRouteTables
  3. Retry if the error is throttling-related (RequestLimitExceeded)
  4. Re-run kops update cluster after any out-of-band AWS changes
Defensive patterns

Strategy: try-catch

Validate before calling

// Pre-verify route table exists before running kops update
aws ec2 describe-route-tables --route-table-ids rtb-0abc123 --region us-east-1

Try / catch

tables, err := cloud.EC2().DescribeRouteTables(ctx, req)
if err != nil {
    var rerr *types.RequestLimitExceeded
    if errors.As(err, &rerr) { /* back off and retry */ }
    var nf *awserr.RequestFailure
    if errors.As(err, &nf) && nf.StatusCode() == 403 { /* fix IAM */ }
    return nil, fmt.Errorf("error listing RouteTables: %v", err)
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05). Data as JSON: /api/errors/6f8bc932dff3a609. Report an issue: GitHub.