grafana/k6 · error

provisioning client init: %w

Error message

provisioning client init: %w

What it means

In provisioning mode (and without an external PushRefID owning the run lifecycle), lazyInitProvisioning lazily constructs the provisioning notifier client; provisioning.NewClient failed (e.g. invalid stack ID or client setup error) and is wrapped as the provisioning client init failure.

Source

Thrown at internal/output/cloud/output.go:557

	// Lazy-construct the provisioning notifier (end-of-test notify).
	// Skipped when PushRefID is set: an external service owns the run
	// lifecycle, so k6 never notifies (testFinished returns early on
	// PushRefID) and the notifier would be unused. Invariant: a nil
	// notifier with provisioningMode true implies PushRefID is set.
	if out.provisioningNotifier == nil && !out.config.PushRefID.Valid {
		// The stack ID is required and passed as int64; provisioning.NewClient
		// enforces the int32 X-Stack-Id boundary internally.
		c, err := provisioning.NewClient(
			out.logger,
			out.config.Token.String, // long-lived k6 token (NOT scoped)
			out.config.Hostv6.String,
			build.Version,
			out.config.StackID.Int64,
			out.config.Timeout.TimeDuration(),
		)
		if err != nil {
			return fmt.Errorf("provisioning client init: %w", err)
		}
		out.provisioningNotifier = c
	}

	// Both deps constructed; arm the gate.
	out.provisioningMode = true

	return nil
}

View on GitHub (pinned to 01ffac6f24)

Solutions

  1. Check the wrapped error for the exact cause (commonly a missing/invalid provisioning stack ID or token)
  2. Verify K6_CLOUD_* provisioning-related environment variables and credentials
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at internal/output/cloud/output.go:557 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of grafana/k6@01ffac6f24 (2026-08-18). Data as JSON: /api/errors/a38e70e4e9bde715. Report an issue: GitHub.