grafana/k6 · error

loading feature definitions

Error message

loading feature definitions: %w

What it means

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.

Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at internal/cmd/features.go:44 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/c5043d6f229cb13a. Report an issue: GitHub.

Appendix: source

Thrown at internal/cmd/features.go:44

	c := &featuresCmd{gs: gs}

	cmd := &cobra.Command{
		Use:   "features",
		Short: "List available feature flags",
		Long:  `List all available feature flags with their lifecycle status and description.`,
		Args:  cobra.NoArgs,
		RunE:  c.run,
	}

	cmd.Flags().BoolVar(&c.isJSON, "json", false, "output in JSON format")

	return cmd
}

func (c *featuresCmd) run(_ *cobra.Command, _ []string) error {
	all, err := features.All()
	if err != nil {
		return fmt.Errorf("loading feature definitions: %w", err)
	}

	if c.isJSON {
		return c.printJSON(all)
	}
	return c.printTable(all)
}

func (c *featuresCmd) printTable(flags []features.Flag) error {
	if len(flags) == 0 {
		return nil
	}

	w := tabwriter.NewWriter(c.gs.Stdout, 0, 0, 3, ' ', 0)
	if _, err := fmt.Fprintln(w, "FEATURE\tLIFECYCLE\tDESCRIPTION"); err != nil {
		return err
	}
	for _, f := range flags {

View on GitHub (pinned to 01ffac6f24)