{"record":{"id":"c9d0d30d6b149058","repo":"grafana/k6","slug":"initializing-feature-flags-w","errorCode":null,"errorMessage":"initializing feature flags: %w","messagePattern":"initializing feature flags: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/cmd/features.go","lineNumber":119,"sourceCode":"\n\tfileConf, err := readDiskConfig(gs)\n\tif err != nil {\n\t\treturn errext.WithExitCodeIfNone(\n\t\t\tfmt.Errorf(\"failed to load the configuration file from the local file system: %w\", err),\n\t\t\texitcodes.InvalidConfig,\n\t\t)\n\t}\n\tjsonSurface := features.Source{Values: fileConf.Features, Supplied: fileConf.Features != nil}\n\n\tenvSurface := maps.Clone(gs.Env)\n\tif envSurface == nil {\n\t\tenvSurface = make(map[string]string)\n\t}\n\tmaps.Copy(envSurface, piState.RuntimeOptions.Env)\n\n\tflags, err := features.Init(gs.Logger, cli, jsonSurface, envSurface)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"initializing feature flags: %w\", err)\n\t}\n\tpiState.FeatureFlags = flags\n\n\tfor _, name := range flags.Activated() {\n\t\tif err := gs.Usage.Strings(\"features\", name); err != nil {\n\t\t\tgs.Logger.WithError(err).Debugf(\"reporting feature usage for %q\", name)\n\t\t}\n\t}\n\n\tpropagateFeatureEnv(piState.RuntimeOptions.Env, flags.Activated())\n\treturn nil\n}\n\nfunc warnOnScriptOptionsFeatures(logger logrus.FieldLogger, opts lib.Options) {\n\tif len(opts.Features) == 0 {\n\t\treturn\n\t}\n\tlogger.WithField(\"source\", \"options\").","sourceCodeStart":101,"sourceCodeEnd":137,"githubUrl":"https://github.com/grafana/k6/blob/01ffac6f245854c1b8adc6a69857c76a15f90022/internal/cmd/features.go#L101-L137","documentation":"Wrapped error from resolveFeatureFlags: features.Init failed while merging feature flag sources (CLI --features, config file, and environment). Typically caused by an unknown feature flag name or a value not accepted by the flag's lifecycle rules.","triggerScenarios":"Thrown at internal/cmd/features.go:119 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the wrapped error for the offending flag name or value","Use 'k6 features' to list valid flag names and their lifecycle status","Remove unsupported overrides from --features, config, or K6_FEATURES env"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"01ffac6f245854c1b8adc6a69857c76a15f90022","analyzedAt":"2026-08-18T03:05:52.393Z","contentChangedAt":"2026-08-18T03:05:52.393Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}