kubernetes/kops · error

creating VMSS VMs client: %w

Error message

creating VMSS VMs client: %w

What it means

newClient constructs the armcompute VirtualMachineScaleSetVMsClient after the VM client. If SDK construction fails, the error is wrapped with 'creating VMSS VMs client'. Like the VM client, this is local construction and usually reflects invalid subscription input or an SDK issue.

Source

Thrown at pkg/nodeidentity/azure/client.go:61

		return nil, fmt.Errorf("error querying instance metadata: %s", err)
	}
	if metadata.SubscriptionID == "" {
		return nil, fmt.Errorf("empty subscription ID")
	}

	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		return nil, fmt.Errorf("creating identity: %w", err)
	}

	vmClient, err := compute.NewVirtualMachinesClient(metadata.SubscriptionID, cred, nil)
	if err != nil {
		return nil, fmt.Errorf("creating VMs client: %w", err)
	}

	vmssClient, err := compute.NewVirtualMachineScaleSetVMsClient(metadata.SubscriptionID, cred, nil)
	if err != nil {
		return nil, fmt.Errorf("creating VMSS VMs client: %w", err)
	}

	return &client{
		vmClient:   vmClient,
		vmssClient: vmssClient,
	}, nil
}

func (c *client) getVMTags(ctx context.Context, providerID string) (map[string]*string, error) {
	if !strings.HasPrefix(providerID, "azure://") {
		return nil, fmt.Errorf("unknown providerID : %s", providerID)
	}

	res, err := arm.ParseResourceID(strings.TrimPrefix(providerID, "azure://"))
	if err != nil {
		return nil, fmt.Errorf("error parsing providerID: %v", err)
	}

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Verify metadata.SubscriptionID is a valid GUID (the same value just succeeded for the VM client, so this is rare)
  2. Check go.mod / vendor for mixed azure-sdk-for-go versions; run go mod tidy and rebuild
  3. Inspect the wrapped error for the exact failure reason
  4. If transient SDK/resolver issues, retry cluster node startup
Defensive patterns

Strategy: validation

Validate before calling

if _, err := uuid.Parse(subscriptionID); err != nil {
    return fmt.Errorf("invalid azure subscription ID %q: %w", subscriptionID, err)
}

Try / catch

if err != nil {
    return fmt.Errorf("creating VMSS VMs client: %w", err)
}

Prevention

When it happens

Trigger: compute.NewVirtualMachineScaleSetVMsClient(metadata.SubscriptionID, cred, nil) returns a non-nil error — typically an invalid subscription ID format or SDK-level initialization failure.

Common situations: Malformed subscription ID from a partial IMDS response; SDK version incompatibilities in the compute arm package; identical root causes to the VMs client error since both take the same inputs.

Related errors


AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05). Data as JSON: /api/errors/e84d9e9453c43511. Report an issue: GitHub.