{"record":{"id":"b50cf5ff189bd09e","repo":"kubernetes/kops","slug":"error-listing-routetables-v","errorCode":null,"errorMessage":"error listing RouteTables: %v","messagePattern":"error listing RouteTables: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/resources/aws/aws.go","lineNumber":925,"sourceCode":"\n\t\tif IsDependencyViolation(err) {\n\t\t\treturn err\n\t\t}\n\t\treturn fmt.Errorf(\"error deleting RouteTable %q: %v\", id, err)\n\t}\n\treturn nil\n}\n\n// DescribeRouteTablesIgnoreTags returns all ec2.RouteTable, ignoring tags\nfunc DescribeRouteTablesIgnoreTags(cloud fi.Cloud) ([]ec2types.RouteTable, error) {\n\tctx := context.TODO()\n\tc := cloud.(awsup.AWSCloud)\n\n\tklog.V(2).Infof(\"Listing all RouteTables\")\n\trequest := &ec2.DescribeRouteTablesInput{}\n\tresponse, err := c.EC2().DescribeRouteTables(ctx, request)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error listing RouteTables: %v\", err)\n\t}\n\n\treturn response.RouteTables, nil\n}\n\nfunc DeleteDhcpOptions(cloud fi.Cloud, r *resources.Resource) error {\n\tctx := context.TODO()\n\tc := cloud.(awsup.AWSCloud)\n\n\tid := r.ID\n\n\tklog.V(2).Infof(\"Deleting EC2 DhcpOptions %q\", id)\n\trequest := &ec2.DeleteDhcpOptionsInput{\n\t\tDhcpOptionsId: &id,\n\t}\n\t_, err := c.EC2().DeleteDhcpOptions(ctx, request)\n\tif err != nil {\n\t\tif awsup.AWSErrorCode(err) == \"InvalidDhcpOptionsID.NotFound\" {","sourceCodeStart":907,"sourceCodeEnd":943,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/pkg/resources/aws/aws.go#L907-L943","documentation":"kOps wraps failures from the EC2 DescribeRouteTables API (called without tag filters, to also find untagged route tables in the VPC). Any API-level failure is wrapped and aborts route table discovery. This is a read-only listing step used by deletion flows to find leftover route tables.","triggerScenarios":"EC2 DescribeRouteTables returns an error: expired/invalid credentials, throttling, network failure, or invalid endpoint/region configuration.","commonSituations":"Long cluster deletions where the AWS session expired mid-run; account-level EC2 rate limiting during parallel kOps operations; corporate proxy blocking EC2 endpoints.","solutions":["Validate access with `aws ec2 describe-route-tables --region <region>` using the same credentials","On throttling errors, reduce parallelism or request an EC2 rate-limit increase, then retry","Refresh credentials (re-login / refresh SSO / re-export keys) and re-run","Check network/proxy reachability to ec2.<region>.amazonaws.com"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// preflight connectivity + auth to EC2\nif _, err := sts.New(sess).GetCallerIdentity(&sts.GetCallerIdentityInput{}); err != nil {\n\treturn fmt.Errorf(\"bad AWS credentials: %w\", err)\n}\nif _, err := ec2cli.DescribeRouteTables(&ec2.DescribeRouteTablesInput{MaxResults: aws.Int64(5)}); err != nil {\n\treturn fmt.Errorf(\"EC2 describe failed in %s: %w\", region, err)\n}","typeGuard":null,"tryCatchPattern":"var tables []ec2types.RouteTable\nerr := backoff.Retry(func() error {\n\tvar e error\n\ttables, e = aws.DescribeRouteTablesIgnoreTags(cloud)\n\treturn e // retry on throttling, permanent on auth\n}, backoff.WithMaxRetries(backoff.NewExponentialBackOff(), 5))","preventionTips":["Refresh credentials before long-running delete operations","Throttle concurrent kOps operations per account/region","Confirm region configuration matches the cluster's actual region","Check corporate proxy allows ec2.<region>.amazonaws.com"],"tags":["aws","ec2","route-table","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"}