{"record":{"id":"c143224aab3670d3","repo":"kubernetes/kops","slug":"error-describing-subnet-s-v","errorCode":null,"errorMessage":"error describing subnet %s: %v","messagePattern":"error describing subnet (.+?): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/new_cluster.go","lineNumber":652,"sourceCode":"\t\treturn \"\", false, fmt.Errorf(\"kubernetes feature gate must include a feature name\")\n\t}\n\n\treturn featureGate, enabled, nil\n}\n\nfunc setupVPC(opt *NewClusterOptions, cluster *api.Cluster, cloud fi.Cloud) error {\n\tctx := context.TODO()\n\tcluster.Spec.Networking.NetworkID = opt.NetworkID\n\n\tswitch cluster.GetCloudProvider() {\n\tcase api.CloudProviderAWS:\n\t\tif cluster.Spec.Networking.NetworkID == \"\" && len(opt.SubnetIDs) > 0 {\n\t\t\tawsCloud := cloud.(awsup.AWSCloud)\n\t\t\tres, err := awsCloud.EC2().DescribeSubnets(ctx, &ec2.DescribeSubnetsInput{\n\t\t\t\tSubnetIds: []string{opt.SubnetIDs[0]},\n\t\t\t})\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"error describing subnet %s: %v\", opt.SubnetIDs[0], err)\n\t\t\t}\n\t\t\tif len(res.Subnets) == 0 || res.Subnets[0].VpcId == nil {\n\t\t\t\treturn fmt.Errorf(\"failed to determine VPC id of subnet %s\", opt.SubnetIDs[0])\n\t\t\t}\n\t\t\tcluster.Spec.Networking.NetworkID = *res.Subnets[0].VpcId\n\t\t}\n\n\t\tif featureflag.Spotinst.Enabled() {\n\t\t\tif opt.SpotinstProduct != \"\" {\n\t\t\t\tcluster.Spec.CloudProvider.AWS.SpotinstProduct = new(opt.SpotinstProduct)\n\t\t\t}\n\t\t\tif opt.SpotinstOrientation != \"\" {\n\t\t\t\tcluster.Spec.CloudProvider.AWS.SpotinstOrientation = new(opt.SpotinstOrientation)\n\t\t\t}\n\t\t}\n\n\tcase api.CloudProviderGCE:\n\t\tif cluster.Spec.CloudConfig == nil {","sourceCodeStart":634,"sourceCodeEnd":670,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/new_cluster.go#L634-L670","documentation":"setupVPC (AWS branch) wraps the EC2 DescribeSubnets error when looking up the first provided subnet ID to infer the cluster's VPC. It fires when --subnet-ids were given without --networkid and the AWS API call fails (bad subnet ID, auth, region, network).","triggerScenarios":"Thrown at upup/pkg/fi/cloudup/new_cluster.go:652 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the subnet IDs exist in the target region and account","Check AWS credentials and region configuration","Pass --networkid explicitly to skip subnet lookup"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}