{"record":{"id":"aacda80fbf362b37","repo":"kubernetes/kops","slug":"found-vmss-without-ip-config-subnet","errorCode":null,"errorMessage":"found VMSS without IP config subnet","messagePattern":"found VMSS without IP config subnet","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/azuretasks/vmscaleset.go","lineNumber":144,"sourceCode":"\n\tnwConfigs := profile.NetworkProfile.NetworkInterfaceConfigurations\n\tif len(nwConfigs) != 1 {\n\t\treturn nil, fmt.Errorf(\"expecting exactly 1 network interface config for %q, found %d: %+v\", *s.Name, len(nwConfigs), nwConfigs)\n\t}\n\tnwConfig := nwConfigs[0]\n\tif nwConfig.Properties == nil {\n\t\treturn nil, fmt.Errorf(\"found VMSS without network interface config properties\")\n\t}\n\tipConfigs := nwConfig.Properties.IPConfigurations\n\tif len(ipConfigs) != 1 {\n\t\treturn nil, fmt.Errorf(\"expecting exactly 1 network interface IP config for %q, found %d: %+v\", *s.Name, len(ipConfigs), ipConfigs)\n\t}\n\tipConfig := ipConfigs[0]\n\tif ipConfig.Properties == nil {\n\t\treturn nil, fmt.Errorf(\"found VMSS without IP config properties\")\n\t}\n\tif ipConfig.Properties.Subnet == nil {\n\t\treturn nil, fmt.Errorf(\"found VMSS without IP config subnet\")\n\t}\n\tif ipConfig.Properties.Subnet.ID == nil {\n\t\treturn nil, fmt.Errorf(\"found VMSS without IP config subnet ID\")\n\t}\n\tsubnetID, err := azure.ParseSubnetID(*ipConfig.Properties.Subnet.ID)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to parse subnet ID %s\", *ipConfig.Properties.Subnet.ID)\n\t}\n\n\tvar loadBalancerID *azure.LoadBalancerID\n\tif ipConfig.Properties.LoadBalancerBackendAddressPools != nil {\n\t\tfor _, i := range ipConfig.Properties.LoadBalancerBackendAddressPools {\n\t\t\tif !strings.Contains(*i.ID, \"api\") {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tloadBalancerID, err = azure.ParseLoadBalancerID(*i.ID)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"failed to parse loadbalancer ID %s\", *i.ID)","sourceCodeStart":126,"sourceCodeEnd":162,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/azuretasks/vmscaleset.go#L126-L162","documentation":"Find reads the subnet from ipConfig.Properties.Subnet to determine which kops subnet the VMSS belongs to; this error fires when the Subnet reference block itself is nil (a separate check covers a nil Subnet.ID). Without it, kops cannot reconcile the scale set against the cluster network topology.","triggerScenarios":"ipConfig.Properties.Subnet == nil in the returned VMSS — the IP config exists but carries no subnet reference, e.g. after someone detached the subnet or the fixture omits it.","commonSituations":"Manual VMSS edits removing the subnet; network refactors where the subnet was changed externally; incomplete test mocks.","solutions":["Re-apply the cluster so kops recreates/updates the VMSS with the correct subnet reference.","Fix the VMSS subnet reference in Azure to point at the kops-managed subnet.","Set Subnet (with a valid ID) in test fixtures.","Verify the referenced subnet still exists and wasn't deleted or renamed."],"exampleFix":"// before\nprops := &compute.VirtualMachineScaleSetIPConfigurationProperties{}\n// after\nprops := &compute.VirtualMachineScaleSetIPConfigurationProperties{Subnet: &compute.APIEntityReference{ID: &subnetID}}","handlingStrategy":"validation","validationCode":"if ip.Properties.Subnet == nil || ip.Properties.Subnet.ID == nil {\n    return fmt.Errorf(\"IP config has no subnet reference; re-apply cluster\")\n}","typeGuard":"func hasSubnetRef(ip *compute.VirtualMachineScaleSetIPConfiguration) bool {\n    return ip != nil && ip.Properties != nil && ip.Properties.Subnet != nil && ip.Properties.Subnet.ID != nil\n}","tryCatchPattern":"found, err := task.Find(ctx, cloud)\nif err != nil {\n    if strings.Contains(err.Error(), \"without IP config subnet\") {\n        return repairSubnetReference(err)\n    }\n    return err\n}","preventionTips":["Never detach or rename the kops-managed subnet referenced by node VMSS.","Verify subnet existence before apply when network changes were made.","Include Subnet with a valid ID in test fixtures."],"tags":["azure","vmss","subnet"],"backgroundTag":"azure-vmss-invalid-profile","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"}