grafana/k6 · error
could not create the
Error message
could not create the '%s' output: %w
What it means
A generic wrapper around the per-output constructor error: the output type WAS found in the registry, but its constructor (e.g. json, csv, cloud, or an extension output) rejected its configuration argument or environment. The underlying %w error names the real cause.
Solutions
- Read the wrapped error text — it comes from the specific output's constructor
- Validate the output-specific argument after '=' (e.g. --out json=file.json) against that output's docs
- For cloud output, verify K6_CLOUD_TOKEN and project settings
- For extension outputs, check the extension's own configuration requirements
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at internal/cmd/outputs.go:171 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of grafana/k6@01ffac6f24 (2026-08-18).
Data as JSON: /api/errors/e240b5b96ca9e4a0.
Report an issue: GitHub.
Appendix: source
Thrown at internal/cmd/outputs.go:171
}
// An output is an extension by membership in the output registry, not by
// its name, so built-in outputs stay out of the "extensions" bucket that
// the usage report filters against the catalog.
if e, isExt := ext.Get(ext.OutputExtension)[outputType]; isExt {
if err := test.preInitState.Usage.Values("extensions", e); err != nil {
gs.Logger.WithError(err).Warnf("Couldn't report usage for output extension %q", outputType)
}
}
params := baseParams
params.OutputType = outputType
params.ConfigArgument = outputArg
params.JSONConfig = test.derivedConfig.Collectors[outputType]
out, err := outputConstructor(params)
if err != nil {
return nil, fmt.Errorf("could not create the '%s' output: %w", outputType, err)
}
if thresholdOut, ok := out.(output.WithThresholds); ok {
thresholdOut.SetThresholds(test.derivedConfig.Thresholds)
}
if builtinMetricOut, ok := out.(output.WithBuiltinMetrics); ok {
builtinMetricOut.SetBuiltinMetrics(test.preInitState.BuiltinMetrics)
}
// If the output is configured to support the archive, and supports it, we proceed
// with building an archive and setting it on the output instance.
if !test.derivedConfig.NoArchiveUpload.Bool {
if archiveOut, ok := out.(output.WithArchive); ok {
archiveOut.SetArchive(test.makeArchive())
}
}
View on GitHub (pinned to 01ffac6f24)