jaegertracing/jaeger · error
could not find 'featuregate' command
Error message
could not find 'featuregate' command
What it means
The jaeger featuregate command is implemented as a subcommand inside the OpenTelemetry collector's command tree. newCommand walks otelCmd.Commands() looking for a subcommand named 'featuregate', removes it from the parent so it can be exposed standalone, and panics if no such subcommand exists. This is a build/wiring invariant: the otelcol components-bundled featuregate command must always be registered.
Source
Thrown at cmd/internal/featuregate/command.go:26
"go.opentelemetry.io/collector/otelcol"
)
func Command() *cobra.Command {
return newCommand(func() *cobra.Command {
settings := otelcol.CollectorSettings{}
return otelcol.NewCommand(settings)
})
}
func newCommand(otelCmdFn func() *cobra.Command) *cobra.Command {
otelCmd := otelCmdFn()
for _, cmd := range otelCmd.Commands() {
if cmd.Name() == "featuregate" {
otelCmd.RemoveCommand(cmd)
return cmd
}
}
panic("could not find 'featuregate' command")
}
View on GitHub (pinned to 806f444784)
Solutions
- Check the otel collector version in go.mod and confirm the featuregate command is still registered under that name; pin/restore a version that has it
- Re-run make generate / rebuild to ensure components and their commands are linked in (blank imports of the collector components)
- If the command was renamed upstream, update the string literal 'featuregate' in cmd/internal/featuregate/command.go to the new name
Example fix
// before
if cmd.Name() == "featuregate" {
// after (if upstream renamed it)
if cmd.Name() == "featuregate" || cmd.Name() == "feature-gate" { Defensive patterns
Strategy: validation
Validate before calling
for _, cmd := range otelCmd.Commands() {
if cmd.Name() == "featuregate" { /* ok */ }
} Try / catch
defer func() { if r := recover(); r != nil { log.Fatalf("featuregate command missing from otelcmd: %v", r) } }() Prevention
- Pin and review otel collector dependency versions; diff the component command registry on upgrades
- Add a startup smoke test that constructs the featuregate command
- Grep upstream releases for featuregate command renames before bumping deps
When it happens
Trigger: Running any code path that builds the standalone featuregate CLI command when the embedded otelcol command tree does not contain a child named 'featuregate' — e.g. after an OTel collector dependency upgrade that renamed or dropped the featuregate command.
Common situations: Upgrading github.com/open-telemetry/opentelemetry-collector or the jaeger component deps where the featuregate command was moved/renamed; a custom build trimming components; copy-pasting newCommand into a binary that wires a different otelcmd.
Related errors
- jaeger exporter is no longer supported, please use otlp
- failed to initialize config: %w
- invalid Jaeger tag pair %q, expected key=value
- abnormal value of http status code: %v
- unrecognized exporter type %s
AI-assisted analysis of jaegertracing/jaeger@806f444784 (2026-09-01).
Data as JSON: /api/errors/d7804937cd543833.
Report an issue: GitHub.