{"record":{"id":"a7053d57b6e65b14","repo":"kubernetes/kops","slug":"unable-to-infer-any-subnets-for-instancegroup-s","errorCode":null,"errorMessage":"unable to infer any Subnets for InstanceGroup %s ","messagePattern":"unable to infer any Subnets for InstanceGroup (.+?) ","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/new_cluster.go","lineNumber":604,"sourceCode":"\t\t\tif len(ig.Spec.Subnets) == 0 {\n\t\t\t\tfor _, subnet := range cluster.Spec.Networking.Subnets {\n\t\t\t\t\tif subnet.Type != api.SubnetTypeDualStack && subnet.Type != api.SubnetTypeUtility {\n\t\t\t\t\t\tg.Spec.Subnets = append(g.Spec.Subnets, subnet.Name)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif len(g.Spec.Subnets) == 0 {\n\t\t\t\tfor _, subnet := range cluster.Spec.Networking.Subnets {\n\t\t\t\t\tif subnet.Type != api.SubnetTypeUtility {\n\t\t\t\t\t\tg.Spec.Subnets = append(g.Spec.Subnets, subnet.Name)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif len(g.Spec.Subnets) == 0 {\n\t\t\treturn nil, fmt.Errorf(\"unable to infer any Subnets for InstanceGroup %s \", g.ObjectMeta.Name)\n\t\t}\n\n\t\tig.AddInstanceGroupNodeLabel()\n\t}\n\n\tresult := NewClusterResult{\n\t\tCluster:        cluster,\n\t\tInstanceGroups: instanceGroups,\n\t\tChannel:        channel,\n\t}\n\treturn &result, nil\n}\n\nfunc parseKubernetesFeatureGate(featureGate string) (string, bool, error) {\n\tfeatureGate = strings.TrimSpace(featureGate)\n\tif featureGate == \"\" {\n\t\treturn \"\", false, fmt.Errorf(\"kubernetes feature gate must not be empty\")\n\t}","sourceCodeStart":586,"sourceCodeEnd":622,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/new_cluster.go#L586-L622","documentation":"NewCluster validation guard: fires when an instance group ends up with zero subnets after inference from the cluster spec. It fires when cluster networking subnets are missing, all filtered out (utility/dualstack rules), or don't match the instance group's requirements, leaving the group unplaceable.","triggerScenarios":"Thrown at upup/pkg/fi/cloudup/new_cluster.go:604 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Define spec.networking.subnets in the cluster spec with non-utility subnets","Check that subnet types match the instance group's placement rules","Specify subnets explicitly on the instance group via spec.subnets"],"exampleFix":null,"handlingStrategy":"validation","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"}