{"record":{"id":"3b0d8977f5436a62","repo":"grafana/k6","slug":"v-d-is-an-unexpected-version","errorCode":null,"errorMessage":"v%d is an unexpected version","messagePattern":"v(.+?) is an unexpected version","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/output/cloud/output.go","lineNumber":504,"sourceCode":"\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 {\n\t\treturn err\n\t}\n\n\tout.SetTestRunID(out.testRunID)\n\tout.versionedOutput.SetTestRunStopCallback(out.testStopFunc)\n\treturn out.versionedOutput.Start()\n}\n\n// lazyInitProvisioning constructs the provisioning-mode dependencies\n// (metrics-push HTTP client and provisioning notifier) when they haven't\n// been injected already. Tests inject mocks via field assignment before\n// calling Start.\nfunc (out *Output) lazyInitProvisioning() error {\n\t// Lazy-construct the metrics-push HTTP client if not already injected\n\t// (tests inject mocks via field assignment).","sourceCodeStart":486,"sourceCodeEnd":522,"githubUrl":"https://github.com/grafana/k6/blob/01ffac6f245854c1b8adc6a69857c76a15f90022/internal/output/cloud/output.go#L486-L522","documentation":"startVersionedOutput switched on the configured cloud API version and hit the default case: the value of K6_CLOUD_API_VERSION (options.cloud.apiVersion) is neither 1 nor 2, so no versioned output implementation exists. (v1 is handled separately with an explicit not-supported error.)","triggerScenarios":"Thrown at internal/output/cloud/output.go:504 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set K6_CLOUD_API_VERSION=2 (v1 is no longer supported)","Remove the invalid apiVersion option so the default version is used"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"01ffac6f245854c1b8adc6a69857c76a15f90022","analyzedAt":"2026-08-18T03:05:52.393Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}