grafana/k6 · error

v1 is not supported anymore

Error message

v1 is not supported anymore

What it means

Thrown during cloud output Start() when the configured Cloud API version is 1. Version 1 of the k6 Cloud API is deprecated and its client code has been removed; the switch only accepts apiVersion2 (and later). Any resolved APIVersion.Int64 of 1 (K6_CLOUD_API_VERSION=1 or apiVersion: 1 in the cloud config) hits this hard error.

Source

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

		return errors.New("TestRunID is required")
	}
	var err error

	usageErr := out.usage.Strings("cloud/test_run_id", out.testRunID)
	if usageErr != nil {
		out.logger.Warning("Couldn't report test run id to usage as part of writing to k6 cloud")
	}

	// TODO: move here the creation of a new cloudapi.Client
	// so in the case the config has been overwritten the client uses the correct
	// value.
	//
	// This logic is handled individually by each single output, it has the downside
	// that we could break the logic and not catch easly it.

	switch out.config.APIVersion.Int64 {
	case int64(apiVersion1):
		err = errors.New("v1 is not supported anymore")
	case int64(apiVersion2):
		out.versionedOutput, err = cloudv2.New(out.logger, out.config, nil)
		if err != nil {
			break
		}

		// Inject provisioning overrides if in provisioning mode.
		if out.provisioningMode {
			if v, ok := out.versionedOutput.(*cloudv2.Output); ok {
				v.SetMetricsHTTPClient(out.metricsPusher)
				v.SetMetricsURL(out.config.MetricsPushURL.String)
			}
		}
	default:
		err = fmt.Errorf("v%d is an unexpected version", out.config.APIVersion.Int64)
	}

	if err != nil {

View on GitHub (pinned to 93accf6570)

Solutions

  1. Remove the API version override entirely so the default (v2) is used
  2. Set K6_CLOUD_API_VERSION=2 (or "apiVersion": 2 in the cloud config JSON)
  3. Update provisioning automation that injects K6_CLOUD_API_VERSION so it no longer forces 1

Example fix

# before
export K6_CLOUD_API_VERSION=1

# after
unset K6_CLOUD_API_VERSION
# or explicitly:
export K6_CLOUD_API_VERSION=2
Defensive patterns

Strategy: validation

Validate before calling

# Reject a pinned v1 before launch:
[ "${K6_CLOUD_API_VERSION:-2}" = "1" ] && { echo 'cloud API v1 is removed; use v2'; exit 1; }
# Go: if conf.APIVersion.Valid && conf.APIVersion.Int64 == 1 { return errors.New("cloud API v1 removed") }

Prevention

When it happens

Trigger: Setting K6_CLOUD_API_VERSION=1 in the environment; passing --log-output / output args with a JSON config containing "apiVersion": 1; embedding k6 as a library and building cloud.Config with APIVersion: null.IntFrom(1); leftover settings from k6 versions where v1 was still selectable.

Common situations: Pinned corporate CI images with old environment defaults; scripts copied from pre-v0.43-era documentation; teams whose provisioning tooling sets the API version explicitly and was never updated after v1 removal.

Related errors


AI-assisted analysis of grafana/k6@93accf6570 (2026-08-15). Data as JSON: /api/errors/c52e42bb677346d2. Report an issue: GitHub.