{"record":{"id":"4dde83b04f1417e6","repo":"kubernetes/kops","slug":"found-vmss-without-ip-config-subnet-id","errorCode":null,"errorMessage":"found VMSS without IP config subnet ID","messagePattern":"found VMSS without IP config subnet ID","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/azuretasks/vmscaleset.go","lineNumber":147,"sourceCode":"\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)\n\t\t\t}\n\t\t}\n\t}","sourceCodeStart":129,"sourceCodeEnd":165,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/azuretasks/vmscaleset.go#L129-L165","documentation":"During Find, kOps reads an existing Azure VM Scale Set from the Azure SDK and validates that its single IP configuration carries a Subnet resource reference with a non-nil ID string. The Subnet ID is required to reconstruct the kops VMScaleSet task (it yields the virtual network and subnet for diffing). If the Azure API returns a subnet subresource whose ID pointer is nil, kOps cannot model the scale set and aborts with this error.","triggerScenarios":"Find() on a VMSS whose networkInterfaceConfigurations[0].properties.ipConfigurations[0].properties.subnet exists but has subnet.id == nil — i.e. an Azure API/SDK response where the Subnet subresource is present but its ARM resource ID was not populated.","commonSituations":"Hand-crafted or mocked Azure responses in tests that set the subnet object but forget its ID; scale sets created or modified outside kOps with an incomplete IP configuration; Azure SDK version changes that alter how subresource IDs are returned.","solutions":["Inspect the VMSS with `az vmss show` and confirm the ipConfigurations[].subnet.id is a full ARM subnet ID; if not, fix the scale set (recreate or update it via kops/az).","If seen in tests, populate Subnet.ID in the mock VirtualMachineScaleSetIPConfiguration fixture.","Verify the Azure SDK (azure-sdk-for-go compute package) version pinned in go.mod matches the one kOps was built against; upgrade/downgrade and run `make gomod`.","Ensure the scale set was provisioned by kops and not manually edited; re-run `kops update cluster` to reconcile."],"exampleFix":"// before (test fixture / malformed resource)\nSubnet: &compute.APIEntityReference{},\n// after\nSubnet: &compute.APIEntityReference{ID: to.Ptr(\"/subscriptions/<sub>/resourceGroups/<rg>/providers/Microsoft.Network/virtualNetworks/<vnet>/subnets/<subnet>\")},","handlingStrategy":"validation","validationCode":"func validateVMSSSubnetID(vmss *compute.VirtualMachineScaleSet) error {\n  ip := vmss.Properties.VirtualMachineProfile.NetworkProfile.NetworkInterfaceConfigurations[0].Properties.IPConfigurations[0]\n  if ip.Properties == nil || ip.Properties.Subnet == nil || ip.Properties.Subnet.ID == nil {\n    return fmt.Errorf(\"VMSS %s has no subnet ID\", *vmss.Name)\n  }\n  return nil\n}","typeGuard":"func hasSubnetID(ip *compute.VirtualMachineScaleSetIPConfiguration) bool {\n  return ip != nil && ip.Properties != nil && ip.Properties.Subnet != nil && ip.Properties.Subnet.ID != nil\n}","tryCatchPattern":null,"preventionTips":["Always provision VMSS through kops so subnet IDs are fully populated","Keep the azure-sdk-for-go compute package pinned and tested with kops","Populate full ARM subnet IDs in any custom ARM/Bicep templates","Add fixtures with complete subnet IDs in tests"],"tags":["azure","vmss","networking","missing-id"],"backgroundTag":"vmss-invalid-subnet-config","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"}