{"record":{"id":"8b5b41041ffeb615","repo":"kubernetes/kops","slug":"expected-at-most-one-ssh-public-key-found-d-keys","errorCode":null,"errorMessage":"expected at most one SSH public key; found %d keys","messagePattern":"expected at most one SSH public key; found (.+?) keys","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/model/azuremodel/vmscaleset.go","lineNumber":142,"sourceCode":"\t\treturn nil, fmt.Errorf(\"unexpected instance group role for instance group: %q, %q\", ig.Name, ig.Spec.Role)\n\t}\n\n\tvar err error\n\tif t.Capacity, err = getCapacity(&ig.Spec); err != nil {\n\t\treturn nil, err\n\t}\n\n\tsp, err := getStorageProfile(&ig.Spec)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tt.StorageProfile = &azuretasks.VMScaleSetStorageProfile{\n\t\tVirtualMachineScaleSetStorageProfile: sp,\n\t}\n\n\tif n := len(b.SSHPublicKeys); n > 0 {\n\t\tif n > 1 {\n\t\t\treturn nil, fmt.Errorf(\"expected at most one SSH public key; found %d keys\", n)\n\t\t}\n\t\tt.SSHPublicKey = new(string(b.SSHPublicKeys[0]))\n\t}\n\n\tif t.UserData, err = b.BootstrapScriptBuilder.ResourceNodeUp(c, ig); err != nil {\n\t\treturn nil, err\n\t}\n\n\tsubnets, err := b.GatherSubnets(ig)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif len(subnets) != 1 {\n\t\treturn nil, fmt.Errorf(\"expected exactly one subnet for InstanceGroup %q; subnets was %s\", ig.Name, ig.Spec.Subnets)\n\t}\n\tsubnet := subnets[0]\n\tt.Subnet = b.LinkToAzureSubnet(subnet)\n","sourceCodeStart":124,"sourceCodeEnd":160,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/pkg/model/azuremodel/vmscaleset.go#L124-L160","documentation":"The model context carries more than one SSH public key, but Azure VM scale sets accept at most one key per scale set; key collection produced multiple entries.","triggerScenarios":"Thrown at pkg/model/azuremodel/vmscaleset.go:142 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Configure a single SSH public key for the cluster","Remove extra keys from the cluster spec or key sources","Re-run kops update"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}