{"record":{"id":"c52e42bb677346d2","repo":"grafana/k6","slug":"v1-is-not-supported-anymore","errorCode":null,"errorMessage":"v1 is not supported anymore","messagePattern":"v1 is not supported anymore","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/output/cloud/output.go","lineNumber":488,"sourceCode":"\t\treturn errors.New(\"TestRunID is required\")\n\t}\n\tvar err error\n\n\tusageErr := out.usage.Strings(\"cloud/test_run_id\", out.testRunID)\n\tif usageErr != nil {\n\t\tout.logger.Warning(\"Couldn't report test run id to usage as part of writing to k6 cloud\")\n\t}\n\n\t// TODO: move here the creation of a new cloudapi.Client\n\t// so in the case the config has been overwritten the client uses the correct\n\t// value.\n\t//\n\t// This logic is handled individually by each single output, it has the downside\n\t// that we could break the logic and not catch easly it.\n\n\tswitch out.config.APIVersion.Int64 {\n\tcase int64(apiVersion1):\n\t\terr = errors.New(\"v1 is not supported anymore\")\n\tcase int64(apiVersion2):\n\t\tout.versionedOutput, err = cloudv2.New(out.logger, out.config, nil)\n\t\tif err != nil {\n\t\t\tbreak\n\t\t}\n\n\t\t// Inject provisioning overrides if in provisioning mode.\n\t\tif out.provisioningMode {\n\t\t\tif v, ok := out.versionedOutput.(*cloudv2.Output); ok {\n\t\t\t\tv.SetMetricsHTTPClient(out.metricsPusher)\n\t\t\t\tv.SetMetricsURL(out.config.MetricsPushURL.String)\n\t\t\t}\n\t\t}\n\tdefault:\n\t\terr = fmt.Errorf(\"v%d is an unexpected version\", out.config.APIVersion.Int64)\n\t}\n\n\tif err != nil {","sourceCodeStart":470,"sourceCodeEnd":506,"githubUrl":"https://github.com/grafana/k6/blob/8d06114777191d21ef885d05c5f8aa9e1ed838ae/internal/output/cloud/output.go#L470-L506","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"# before\nexport K6_CLOUD_API_VERSION=1\nk6 run -o cloud script.js\n# after\nunset K6_CLOUD_API_VERSION   # or: export K6_CLOUD_API_VERSION=2\nk6 run -o cloud script.js","handlingStrategy":"validation","validationCode":"// Shell: reject the removed v1 API before running\nif [ \"${K6_CLOUD_API_VERSION:-2}\" = \"1\" ]; then\n  echo \"k6 cloud API v1 is removed; using v2\" >&2\n  unset K6_CLOUD_API_VERSION\nfi\nk6 run -o cloud script.js","typeGuard":"function supportsCloudApiVersion(v) {\n  return Number(v) >= 2;\n}","tryCatchPattern":null,"preventionTips":["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"],"tags":["cloud","api-version","migration","configuration","k6"],"backgroundTag":"deprecated-api-version","analyzedSha":"8d06114777191d21ef885d05c5f8aa9e1ed838ae","analyzedAt":"2026-08-18T03:05:52.393Z","contentChangedAt":"2026-08-18T03:05:52.393Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}