{"record":{"id":"f2f3844f728efd7b","repo":"kubernetes/kops","slug":"expecting-exactly-1-network-interface-config-for","errorCode":null,"errorMessage":"expecting exactly 1 network interface config for %q, found %d: %+v","messagePattern":"expecting exactly 1 network interface config for %q, found (.+?): %\\+v","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/azuretasks/vmscaleset.go","lineNumber":129,"sourceCode":"\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)\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\")","sourceCodeStart":111,"sourceCodeEnd":147,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/azuretasks/vmscaleset.go#L111-L147","documentation":"kops models each VMSS node group with exactly one network interface configuration; Find enforces this by erroring when the found scale set has any other count. The message includes the scale set name, found count, and the full configs for diagnosis.","triggerScenarios":"profile.NetworkProfile.NetworkInterfaceConfigurations has length != 1 — e.g. someone added a second NIC to the scale set, or a fixture returns zero/multiple NIC configs.","commonSituations":"Manual edits or external IaC adding extra NICs (e.g. for private connectivity); migrating a VMSS from another tool that used multiple NICs; mock returning empty NIC list.","solutions":["Inspect the VMSS (az vmss show) and remove extra NIC configurations so exactly one remains.","Delete the divergent VMSS and run kops apply to recreate it per the cluster spec.","Ensure test fixtures return exactly one NetworkInterfaceConfiguration.","Manage the VMSS only through kops to prevent spec drift."],"exampleFix":"// before (fixture)\nnics := []*compute.VirtualMachineScaleSetNetworkConfiguration{}\n// after\nnics := []*compute.VirtualMachineScaleSetNetworkConfiguration{ {Name: &nicName, ...} }","handlingStrategy":"validation","validationCode":"nics := vmss.Properties.VirtualMachineProfile.NetworkProfile.NetworkInterfaceConfigurations\nif nics == nil || len(nics) != 1 {\n    return fmt.Errorf(\"VMSS must have exactly 1 NIC config, found %d\", len(nics))\n}","typeGuard":"func hasSingleNIC(v *compute.VirtualMachineScaleSet) bool {\n    if v == nil || v.Properties == nil || v.Properties.VirtualMachineProfile == nil ||\n        v.Properties.VirtualMachineProfile.NetworkProfile == nil {\n        return false\n    }\n    return len(v.Properties.VirtualMachineProfile.NetworkProfile.NetworkInterfaceConfigurations) == 1\n}","tryCatchPattern":"found, err := task.Find(ctx, cloud)\nif err != nil {\n    var nf *NICCountError\n    if errors.As(err, &nf) {\n        return replaceScaleSetWithSpec(err)\n    }\n    return err\n}","preventionTips":["Do not attach secondary NICs to kops-managed node scale sets.","Check for drift with kops get/apply --dry-run before changes.","Return exactly one NIC configuration from fixtures."],"tags":["azure","vmss","network-interface"],"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"}