kubernetes/kops · error
creating VMs client: %w
Error message
creating VMs client: %w
What it means
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.
Source
Thrown at upup/pkg/fi/cloudup/azure/verifier.go:317
return nil, fmt.Errorf("empty resource group name")
}
if metadata.SubscriptionID == "" {
return nil, fmt.Errorf("empty subscription ID")
}
klog.V(4).Infof("Azure verifier client using subscription %q resource group %q", metadata.SubscriptionID, metadata.ResourceGroupName)
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
return nil, fmt.Errorf("creating an identity: %w", err)
}
nisClient, err := network.NewInterfacesClient(metadata.SubscriptionID, cred, nil)
if err != nil {
return nil, fmt.Errorf("creating interfaces client: %w", err)
}
vmsClient, err := compute.NewVirtualMachinesClient(metadata.SubscriptionID, cred, nil)
if err != nil {
return nil, fmt.Errorf("creating VMs client: %w", err)
}
vmssVMsClient, err := compute.NewVirtualMachineScaleSetVMsClient(metadata.SubscriptionID, cred, nil)
if err != nil {
return nil, fmt.Errorf("creating VMSSVMs client: %w", err)
}
return &client{
subscriptionID: metadata.SubscriptionID,
resourceGroup: metadata.ResourceGroupName,
nisClient: nisClient,
vmsClient: vmsClient,
vmssVMsClient: vmssVMsClient,
}, nil
}
View on GitHub (pinned to 4c8573c808)
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
Defensive patterns
Strategy: try-catch
Validate before calling
if _, err := uuid.Parse(subscriptionID); err != nil {
return fmt.Errorf("invalid subscription ID %q", subscriptionID)
} Try / catch
_, err := newVerifierClient(ctx)
if err != nil && strings.Contains(err.Error(), "creating VMs client") {
// inspect wrapped cause: bad input or SDK issue; repair deps or inputs, then retry
} Prevention
- 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
When it happens
Trigger: compute.NewVirtualMachinesClient(subscriptionID, cred, nil) returns non-nil err during newVerifierClient bootstrap, immediately after the interfaces client succeeded.
Common situations: 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.
Related errors
- creating VMs client: %w
- creating VMSS VMs client: %w
- creating interfaces client: %w
- DNS not implemented on azureCloud
- FindVPCInfo not implemented on azureCloud, use FindVNetInfo
AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05).
Data as JSON: /api/errors/e7907deda016798d.
Report an issue: GitHub.