{"record":{"id":"e7907deda016798d","repo":"kubernetes/kops","slug":"creating-vms-client-w-e7907d","errorCode":null,"errorMessage":"creating VMs client: %w","messagePattern":"creating VMs client: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/azure/verifier.go","lineNumber":317,"sourceCode":"\t\treturn nil, fmt.Errorf(\"empty resource group name\")\n\t}\n\tif metadata.SubscriptionID == \"\" {\n\t\treturn nil, fmt.Errorf(\"empty subscription ID\")\n\t}\n\tklog.V(4).Infof(\"Azure verifier client using subscription %q resource group %q\", metadata.SubscriptionID, metadata.ResourceGroupName)\n\n\tcred, err := azidentity.NewDefaultAzureCredential(nil)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"creating an identity: %w\", err)\n\t}\n\n\tnisClient, err := network.NewInterfacesClient(metadata.SubscriptionID, cred, nil)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"creating interfaces client: %w\", err)\n\t}\n\tvmsClient, err := compute.NewVirtualMachinesClient(metadata.SubscriptionID, cred, nil)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"creating VMs client: %w\", err)\n\t}\n\tvmssVMsClient, err := compute.NewVirtualMachineScaleSetVMsClient(metadata.SubscriptionID, cred, nil)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"creating VMSSVMs client: %w\", err)\n\t}\n\n\treturn &client{\n\t\tsubscriptionID: metadata.SubscriptionID,\n\t\tresourceGroup:  metadata.ResourceGroupName,\n\t\tnisClient:      nisClient,\n\t\tvmsClient:      vmsClient,\n\t\tvmssVMsClient:  vmssVMsClient,\n\t}, nil\n}\n","sourceCodeStart":299,"sourceCodeEnd":332,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/azure/verifier.go#L299-L332","documentation":"Same failure class as the interfaces client, but for compute.NewVirtualMachinesClient: the SDK refused to build the VMs management client, so newVerifierClient aborts before the verifier can query VM state.","triggerScenarios":"compute.NewVirtualMachinesClient(subscriptionID, cred, nil) returns non-nil err during newVerifierClient bootstrap, immediately after the interfaces client succeeded.","commonSituations":"Corrupted/partial go.sum or dependency replacement causing init failure; invalid client options struct; SDK regression after version bump; environment-specific init panic recovered as error.","solutions":["Read the wrapped cause and fix the underlying input (usually subscription ID or credential)","Run make gomod / go mod tidy to repair the Azure SDK dependency set after a bump","Pin a known-good azure-sdk-for-go version used by kops if a new release regressed","Verify with a minimal snippet that compute.NewVirtualMachinesClient works with the same cred/subscription"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"if _, err := uuid.Parse(subscriptionID); err != nil {\n\treturn fmt.Errorf(\"invalid subscription ID %q\", subscriptionID)\n}","typeGuard":null,"tryCatchPattern":"_, err := newVerifierClient(ctx)\nif err != nil && strings.Contains(err.Error(), \"creating VMs client\") {\n\t// inspect wrapped cause: bad input or SDK issue; repair deps or inputs, then retry\n}","preventionTips":["Validate subscription GUID before constructing clients","Keep Azure compute SDK modules consistent via make gomod","Pin known-good SDK versions in kops go.mod","Smoke-test client construction in unit tests with fake creds"],"tags":["azure","sdk","compute-client"],"backgroundTag":"azure-client-init-failed","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"}