grafana/k6 · error
v1 is not supported anymore
Error message
v1 is not supported anymore
What it means
The cloud output selects its client behavior from the configured API version and only implements version 2; requesting version 1 returns 'v1 is not supported anymore'. The v1 cloud API was removed from k6, so any environment/config still pinning apiVersion=1 (K6_CLOUD_API_VERSION or options.cloud settings from an old setup) fails during startVersionedOutput.
Solutions
- Remove the K6_CLOUD_API_VERSION override entirely — modern k6 defaults to v2
- Explicitly set K6_CLOUD_API_VERSION=2 if you must pin the value
- Sweep CI images, .env files, and wrapper scripts for stale K6_CLOUD_* settings after upgrading k6
Example fix
# before export K6_CLOUD_API_VERSION=1 k6 run -o cloud script.js # after unset K6_CLOUD_API_VERSION # or: export K6_CLOUD_API_VERSION=2 k6 run -o cloud script.js
Defensive patterns
Strategy: validation
Validate before calling
// Shell: reject the removed v1 API before running
if [ "${K6_CLOUD_API_VERSION:-2}" = "1" ]; then
echo "k6 cloud API v1 is removed; using v2" >&2
unset K6_CLOUD_API_VERSION
fi
k6 run -o cloud script.js Type guard
function supportsCloudApiVersion(v) {
return Number(v) >= 2;
} Prevention
- Audit CI images and .env files for K6_CLOUD_API_VERSION after every k6 upgrade
- Prefer unset (default) over pinning the cloud API version
- Track k6 release notes for removed API versions when you pin cloud settings
When it happens
Trigger: K6_CLOUD_API_VERSION=1 exported in a CI image from an older setup; a committed config or wrapper script that pins the cloud apiVersion to 1; upgrade of k6 without cleaning legacy environment variables.
Common situations: Long-lived CI runners carrying stale K6_* variables; documentation or templates predating the v1 removal; scripts that worked on older k6 and broke after upgrading the binary.
Related errors
- access token not configured
- both K6_CLOUD_METRICS_PUSH_URL and K6_CLOUD_TEST_RUN_TOKEN…
- no project specified. Use --project-id, set…
- script name not set, please specify K6_CLOUD_NAME or…
- stack ID not configured
AI-assisted analysis of grafana/k6@8d06114777 (2026-08-18).
Data as JSON: /api/errors/c52e42bb677346d2.
Report an issue: GitHub.
Appendix: source
Thrown at internal/output/cloud/output.go:488
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 8d06114777)