{"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":489,"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":471,"sourceCodeEnd":507,"githubUrl":"https://github.com/grafana/k6/blob/93accf6570dcd306ca5e99cc44c393ee3797761b/internal/output/cloud/output.go#L471-L507","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Remove the API version override entirely so the default (v2) is used","Set K6_CLOUD_API_VERSION=2 (or \"apiVersion\": 2 in the cloud config JSON)","Update provisioning automation that injects K6_CLOUD_API_VERSION so it no longer forces 1"],"exampleFix":"# before\nexport K6_CLOUD_API_VERSION=1\n\n# after\nunset K6_CLOUD_API_VERSION\n# or explicitly:\nexport K6_CLOUD_API_VERSION=2","handlingStrategy":"validation","validationCode":"# Reject a pinned v1 before launch:\n[ \"${K6_CLOUD_API_VERSION:-2}\" = \"1\" ] && { echo 'cloud API v1 is removed; use v2'; exit 1; }\n# Go: if conf.APIVersion.Valid && conf.APIVersion.Int64 == 1 { return errors.New(\"cloud API v1 removed\") }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Stop setting K6_CLOUD_API_VERSION entirely; the default is v2","Grep CI images and .env files for K6_CLOUD_API_VERSION during k6 upgrades","Subscribe to k6 release notes when deprecations are announced"],"tags":["k6","cloud","versioning","deprecation","config"],"backgroundTag":null,"analyzedSha":"93accf6570dcd306ca5e99cc44c393ee3797761b","analyzedAt":"2026-08-15T21:23:27.118Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}