{"record":{"id":"f0d539b1ccdc37c8","repo":"kubernetes/kops","slug":"subnet-id-is-required","errorCode":null,"errorMessage":"Subnet.ID is required","messagePattern":"Subnet\\.ID is required","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/linodetasks/instance.go","lineNumber":124,"sourceCode":"\tfor _, instance := range instances {\n\t\tif instance.Type != i.Type {\n\t\t\tneedsUpdate = append(needsUpdate, instance.Label)\n\t\t\tcontinue\n\t\t}\n\t\tif instance.Image != i.Image {\n\t\t\tneedsUpdate = append(needsUpdate, instance.Label)\n\t\t\tcontinue\n\t\t}\n\t\tif instance.Region != i.Region {\n\t\t\tneedsUpdate = append(needsUpdate, instance.Label)\n\t\t\tcontinue\n\t\t}\n\t\tif !hasAllTags(instance.Tags, expectedTags) {\n\t\t\tneedsUpdate = append(needsUpdate, instance.Label)\n\t\t\tcontinue\n\t\t}\n\t\tif i.Subnet == nil || i.Subnet.ID == nil {\n\t\t\treturn nil, fmt.Errorf(\"Subnet.ID is required\")\n\t\t}\n\t\tinterfaces, err := cloud.Client().ListInterfaces(c.Context(), instance.ID, nil)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"error listing Akamai (Linode) interfaces for instance %q: %w\", instance.Label, err)\n\t\t}\n\t\tif !hasExpectedInterfaces(interfaces, fi.ValueOf(i.Subnet.ID), fi.ValueOf(i.RequirePublicInterface)) {\n\t\t\tneedsUpdate = append(needsUpdate, instance.Label)\n\t\t\tcontinue\n\t\t}\n\t}\n\n\tactual := *i\n\tactual.NeedsUpdate = needsUpdate\n\tactual.Count = len(instances)\n\n\treturn &actual, nil\n}\n","sourceCodeStart":106,"sourceCodeEnd":142,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/linodetasks/instance.go#L106-L142","documentation":"linodetasks.Instance.Find reconciles existing Linode instances against the desired state. For each matching instance it requires the task's Subnet (and its API ID) to be set, because interface comparison needs the VPC/subnet identifier. If i.Subnet or i.Subnet.ID is nil, Find aborts with 'Subnet.ID is required' rather than guessing. This is a specification error in the task definition, not a cloud-side problem.","triggerScenarios":"Find() iterates instances and reaches the subnet check on an Instance task whose Subnet field was not linked (nil) or whose Subnet task has no ID (not yet resolved/created). Happens during kOps reconciliation when the network topology was changed or the subnet task failed to populate.","commonSituations":"Cluster spec missing/renamed subnet reference so the Instance task's Subnet link is nil; subnet task executed out of order or failed silently so its ID was never assigned; hand-edited manifests omitting the subnet binding; partial apply where only Instance tasks ran.","solutions":["Ensure the cluster spec defines the subnet and that the Instance task's Subnet field is linked to it before Find runs","Run the full apply so the subnet task executes and its ID is populated, not just the instance task","Check that i.Subnet.ID is set in the lifecycle order (subnet creation precedes instance reconciliation)","Validate the manifest / cluster spec against the linode topology requirements"],"exampleFix":"// before\nc.Subnet = nil // or unlinked task\n// after\nc.Subnet = &linodetasks.Subnet{Name: s(\"cluster-subnet\"), ID: fi.PtrTo(\"existing-subnet-id\")}","handlingStrategy":"validation","validationCode":"if i.Subnet == nil || i.Subnet.ID == nil {\n\treturn errors.New(\"linode Instance task requires a Subnet with an ID\")\n}","typeGuard":"func subnetReady(i *linodetasks.Instance) bool {\n\treturn i != nil && i.Subnet != nil && i.Subnet.ID != nil\n}","tryCatchPattern":"instances, err := it.Find(context.Background())\nif err != nil {\n\tif strings.Contains(err.Error(), \"Subnet.ID is required\") {\n\t\treturn fmt.Errorf(\"link the Instance task's Subnet and ensure the subnet task ran: %w\", err)\n\t}\n\treturn err\n}","preventionTips":["Always link Instance.Subnet to a defined Subnet task in the spec","Run full applies so subnet tasks execute before instance reconciliation","Order lifecycle tasks: subnet creation before instance find/update","Validate manifests for nil subnet references before applying"],"tags":["linode","subnet","reconciliation","config"],"backgroundTag":"missing-required-argument","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"}