{"record":{"id":"b1924a7ab7e1ab1c","repo":"kubernetes/kops","slug":"subnet-task-q-not-found-for-instancegroup-q","errorCode":null,"errorMessage":"subnet task %q not found for InstanceGroup %q","messagePattern":"subnet task %q not found for InstanceGroup %q","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/model/linodemodel/instances.go","lineNumber":157,"sourceCode":"\t\trequirePublic = false\n\t}\n\n\treturn &requirePublic\n}\n\n// findInstanceTask searches for the instance task corresponding to the given instance group name in the provided context.\nfunc findSubnetTask(c *fi.CloudupModelBuilderContext, subnetTaskName string, ig *kops.InstanceGroup) (*linodetasks.Subnet, error) {\n\tfor _, task := range c.Tasks {\n\t\tsubnet, ok := task.(*linodetasks.Subnet)\n\t\tif !ok {\n\t\t\tcontinue\n\t\t}\n\t\tif fi.ValueOf(subnet.Name) == subnetTaskName {\n\t\t\treturn subnet, nil\n\t\t}\n\t}\n\n\treturn nil, fmt.Errorf(\"subnet task %q not found for InstanceGroup %q\", subnetTaskName, ig.Name)\n}\n","sourceCodeStart":139,"sourceCodeEnd":159,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/pkg/model/linodemodel/instances.go#L139-L159","documentation":"findSubnetTask scans the model-builder context's task list for a linodetasks.Subnet whose normalized name matches the subnet the InstanceGroup references. If no Subnet task with the expected name (clusterName-subnetName, normalized) exists, the build fails with this error. It indicates a mismatch between the instance group's subnet reference and the subnets created by the network model builder.","triggerScenarios":"An InstanceGroup references a subnet name that is not present in cluster.spec.networking.subnets, so NetworkModelBuilder never created a matching Subnet task; or the name normalization differs (e.g. subnet named with characters normalized away causing a different label).","commonSituations":"Typo in the instance group's subnets list; subnet deleted from cluster spec while instance group still references it; cluster name too long causing normalized label truncation collisions/mismatches; building an instance group against a cluster whose network model build was skipped.","solutions":["Ensure the subnet name in the InstanceGroup's spec.subnets matches a subnet declared in cluster.spec.networking.subnets exactly.","Run kops get cluster -o yaml and cross-check subnet names.","If Linode label normalization truncates names, shorten the subnet name so the full label fits Linode limits.","Re-run kops update so the network model builder regenerates Subnet tasks before instance tasks."],"exampleFix":"// before: instance group referencing a subnet missing from the cluster spec\nig.Spec.Subnets = [\"us-east-1b\"]  // cluster only defines \"us-east-1a\"\n// after\nig.Spec.Subnets = [\"us-east-1a\"]","handlingStrategy":"validation","validationCode":"clusterSubnets := map[string]bool{}\nfor _, s := range cluster.Spec.Networking.Subnets {\n    clusterSubnets[s.Name] = true\n}\nfor _, ig := range instanceGroups {\n    for _, sn := range ig.Spec.Subnets {\n        if !clusterSubnets[sn] {\n            return fmt.Errorf(\"instance group %s references undeclared subnet %q\", ig.Name, sn)\n        }\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep InstanceGroup spec.subnets in sync with cluster.spec.networking.subnets.","Run kops create --dry-run to catch dangling subnet references early.","Use short subnet names so normalized labels are not truncated.","Rebuild the full model (network builder included) before instance tasks in custom code."],"tags":["linode","subnet","model-builder","task-dependency"],"backgroundTag":"subnet-task-not-found","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"}