{"record":{"id":"888015f11deb3897","repo":"kubernetes/kops","slug":"found-vmss-without-network-profile","errorCode":null,"errorMessage":"found VMSS without network profile","messagePattern":"found VMSS without network profile","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/azuretasks/vmscaleset.go","lineNumber":119,"sourceCode":"\tif found == nil {\n\t\treturn nil, nil\n\t}\n\n\tif found.ID == nil {\n\t\treturn nil, fmt.Errorf(\"found VMSS without ID\")\n\t}\n\tif found.Properties == nil {\n\t\treturn nil, fmt.Errorf(\"found VMSS without properties\")\n\t}\n\tif fi.ValueOf(found.Properties.ProvisioningState) == \"Failed\" {\n\t\tklog.Warningf(\"found VMSS %q in failed provisioning state\", *s.Name)\n\t\treturn nil, nil\n\t}\n\tif found.Properties.VirtualMachineProfile == nil {\n\t\treturn nil, fmt.Errorf(\"found VMSS without VM profile\")\n\t}\n\tif found.Properties.VirtualMachineProfile.NetworkProfile == nil {\n\t\treturn nil, fmt.Errorf(\"found VMSS without network profile\")\n\t}\n\tif found.Properties.VirtualMachineProfile.OSProfile == nil {\n\t\treturn nil, fmt.Errorf(\"found VMSS without OS profile\")\n\t}\n\n\tprofile := found.Properties.VirtualMachineProfile\n\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)","sourceCodeStart":101,"sourceCodeEnd":137,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/azuretasks/vmscaleset.go#L101-L137","documentation":"Find reads the VMSS network interface configuration to discover the subnet and backend pools; this requires VirtualMachineProfile.NetworkProfile to be non-nil. The error means Azure returned a scale set whose VM profile has no network profile section.","triggerScenarios":"VirtualMachineProfile.NetworkProfile == nil in the returned VMSS — created without networkInterfaceConfigurations, or the fixture omits NetworkProfile.","commonSituations":"VMSS hand-edited or created by other tooling without NIC config; partially applied update removing network profile; incomplete test mocks.","solutions":["Re-apply the cluster (kops apply) so kops recreates the VMSS with a proper network profile.","Delete the malformed VMSS and let kops recreate it.","Add NetworkProfile with NetworkInterfaceConfigurations to test fixtures.","Check that external automation is not overwriting the VMSS network settings."],"exampleFix":"// before\nprofile := &compute.VirtualMachineScaleSetVMProfile{}\n// after\nprofile := &compute.VirtualMachineScaleSetVMProfile{NetworkProfile: &compute.VirtualMachineScaleSetNetworkProfile{NetworkInterfaceConfigurations: ...}}","handlingStrategy":"validation","validationCode":"p := vmss.Properties.VirtualMachineProfile\nif p.NetworkProfile == nil || len(p.NetworkProfile.NetworkInterfaceConfigurations) == 0 {\n    return fmt.Errorf(\"VMSS has no network profile/NICs; re-apply cluster\")\n}","typeGuard":"func hasNetworkProfile(v *compute.VirtualMachineScaleSet) bool {\n    return v != nil && v.Properties != nil && v.Properties.VirtualMachineProfile != nil &&\n        v.Properties.VirtualMachineProfile.NetworkProfile != nil\n}","tryCatchPattern":"found, err := task.Find(ctx, cloud)\nif err != nil {\n    if strings.Contains(err.Error(), \"without network profile\") {\n        return applyClusterSpec()\n    }\n    return err\n}","preventionTips":["Do not add or remove NIC configurations outside the kops spec.","Keep NetworkProfile populated in mocks.","Audit the resource group for drift before applying."],"tags":["azure","vmss","network-profile"],"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-12T07:17:12.445Z"}