{"record":{"id":"c5043d6f229cb13a","repo":"grafana/k6","slug":"loading-feature-definitions-w","errorCode":null,"errorMessage":"loading feature definitions: %w","messagePattern":"loading feature definitions: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/cmd/features.go","lineNumber":44,"sourceCode":"\tc := &featuresCmd{gs: gs}\n\n\tcmd := &cobra.Command{\n\t\tUse:   \"features\",\n\t\tShort: \"List available feature flags\",\n\t\tLong:  `List all available feature flags with their lifecycle status and description.`,\n\t\tArgs:  cobra.NoArgs,\n\t\tRunE:  c.run,\n\t}\n\n\tcmd.Flags().BoolVar(&c.isJSON, \"json\", false, \"output in JSON format\")\n\n\treturn cmd\n}\n\nfunc (c *featuresCmd) run(_ *cobra.Command, _ []string) error {\n\tall, err := features.All()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"loading feature definitions: %w\", err)\n\t}\n\n\tif c.isJSON {\n\t\treturn c.printJSON(all)\n\t}\n\treturn c.printTable(all)\n}\n\nfunc (c *featuresCmd) printTable(flags []features.Flag) error {\n\tif len(flags) == 0 {\n\t\treturn nil\n\t}\n\n\tw := tabwriter.NewWriter(c.gs.Stdout, 0, 0, 3, ' ', 0)\n\tif _, err := fmt.Fprintln(w, \"FEATURE\\tLIFECYCLE\\tDESCRIPTION\"); err != nil {\n\t\treturn err\n\t}\n\tfor _, f := range flags {","sourceCodeStart":26,"sourceCodeEnd":62,"githubUrl":"https://github.com/grafana/k6/blob/01ffac6f245854c1b8adc6a69857c76a15f90022/internal/cmd/features.go#L26-L62","documentation":"Wrapped error in the 'k6 features' command's run: features.All() failed to load the compiled-in feature flag definitions. This is an internal/data fault, not user input — the flag registry could not be assembled.","triggerScenarios":"Thrown at internal/cmd/features.go:44 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":"try-catch","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"}