{"record":{"id":"1354589800a18c5e","repo":"kubernetes/kops","slug":"error-creating-routetable-v","errorCode":null,"errorMessage":"error creating RouteTable: %v","messagePattern":"error creating RouteTable: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/awstasks/routetable.go","lineNumber":187,"sourceCode":"\nfunc (_ *RouteTable) RenderAWS(t *awsup.AWSAPITarget, a, e, changes *RouteTable) error {\n\tctx := context.TODO()\n\tif a == nil {\n\t\tvpcID := e.VPC.ID\n\t\tif vpcID == nil {\n\t\t\treturn fi.RequiredField(\"VPC.ID\")\n\t\t}\n\n\t\tklog.V(2).Infof(\"Creating RouteTable with VPC: %q\", *vpcID)\n\n\t\trequest := &ec2.CreateRouteTableInput{\n\t\t\tVpcId:             vpcID,\n\t\t\tTagSpecifications: awsup.EC2TagSpecification(ec2types.ResourceTypeRouteTable, e.Tags),\n\t\t}\n\n\t\tresponse, err := t.Cloud.EC2().CreateRouteTable(ctx, request)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error creating RouteTable: %v\", err)\n\t\t}\n\n\t\trt := response.RouteTable\n\t\te.ID = rt.RouteTableId\n\t}\n\n\treturn t.AddAWSTags(*e.ID, e.Tags)\n}\n\ntype terraformRouteTable struct {\n\tVPCID *terraformWriter.Literal `cty:\"vpc_id\"`\n\tTags  map[string]string        `cty:\"tags\"`\n}\n\nfunc (_ *RouteTable) RenderTerraform(t *terraform.TerraformTarget, a, e, changes *RouteTable) error {\n\t// We use the role tag as a concise and stable identifier\n\ttag := e.Tags[awsup.TagNameKopsRole]\n\tif tag != \"\" {","sourceCodeStart":169,"sourceCodeEnd":205,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/awstasks/routetable.go#L169-L205","documentation":"RenderAWS calls EC2 CreateRouteTable to provision a new route table tagged with the cluster tags; any AWS rejection is wrapped as this error. Unlike the find* helpers, this wraps the whole AWS error, so the root cause is embedded in %v.","triggerScenarios":"CreateRouteTable fails: VPC ID invalid/deleted, missing ec2:CreateRouteTable permission, throttling, or invalid TagSpecifications (too many/illegal tag values).","commonSituations":"VPC deleted out-of-band while cluster state references it; IAM policy too restrictive; AWS throttling during large cluster creation; tag value containing invalid characters from an unusual cluster name.","solutions":["Re-run `kops update cluster` to retry transient failures","Verify the VPC exists: `aws ec2 describe-vpcs --vpc-ids <vpc-id>`","Confirm IAM grants ec2:CreateRouteTable (and ec2:CreateTags)","Check cluster name / tags for invalid characters if TagValidationError appears in the wrapped error"],"exampleFix":"// IAM before: no ec2:CreateRouteTable\n// after:\n{\"Effect\":\"Allow\",\"Action\":[\"ec2:CreateRouteTable\",\"ec2:CreateTags\"],\"Resource\":\"*\"}","handlingStrategy":"try-catch","validationCode":"aws ec2 describe-vpcs --vpc-ids vpc-123 --region us-east-1 || echo \"VPC missing\"\n","typeGuard":null,"tryCatchPattern":"var aerr smithy.APIError\nif errors.As(err, &aerr) {\n  switch aerr.ErrorCode() {\n  case \"ThrottlingException\": backoffAndRetry()\n  case \"InvalidVpcID.NotFound\": recreateVPCState()\n  default: return err\n  }\n}","preventionTips":["Don't delete VPCs managed by kOps out-of-band","IAM must allow ec2:CreateRouteTable and ec2:CreateTags","Keep cluster names within tag-value character limits"],"tags":["aws","ec2","routetable","infrastructure"],"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-12T12:17:11.808Z"}