jaegertracing/jaeger · error

invalid configuration for trace storage '%s': %w

Error message

invalid configuration for trace storage '%s': %w

What it means

storageExt.Start validates every trace backend configuration (cfg.Validate()) before any factory is created, so config mistakes fail fast at startup. When a TraceBackends entry fails validation, the error is wrapped as 'invalid configuration for trace storage %s'.

Source

Thrown at cmd/jaeger/internal/extension/jaegerstorage/extension.go:147

		TracerProvider: telset.TracerProvider,
	}
	return &storageExt{
		config:           cfg,
		telset:           tset,
		factories:        make(map[string]tracestore.Factory),
		metricsFactories: make(map[string]storage.MetricStoreFactory),
	}
}

func (s *storageExt) Start(_ context.Context, host component.Host) error {
	// Set host in telset for use in lazy factory initialization
	s.telset.Host = host
	s.telset.Metrics = otelmetrics.NewFactory(s.telset.MeterProvider).Namespace(metrics.NSOptions{Name: "jaeger"})

	// Validate configurations early to catch errors at startup
	for name, cfg := range s.config.TraceBackends {
		if err := cfg.Validate(); err != nil {
			return fmt.Errorf("invalid configuration for trace storage '%s': %w", name, err)
		}
	}
	for name, cfg := range s.config.MetricBackends {
		if err := cfg.Validate(); err != nil {
			return fmt.Errorf("invalid configuration for metric storage '%s': %w", name, err)
		}
	}

	return nil
}

func (s *storageExt) Shutdown(context.Context) error {
	var errs []error
	for _, factory := range s.factories {
		if closer, ok := factory.(io.Closer); ok {
			err := closer.Close()
			if err != nil {
				errs = append(errs, err)

View on GitHub (pinned to 806f444784)

Solutions

  1. Read the inner validation error to find the offending field and fix the named trace backend config
  2. Ensure each backend entry configures exactly one backend type with valid parameters
  3. Run config validation locally (config.Validate / otelcol validate) before deploying

Example fix

// before: two backends in one entry
backends:
  primary:
    cassandra: { ... }
    elasticsearch: { ... }
// after
backends:
  primary:
    elasticsearch: { ... }
Defensive patterns

Strategy: validation

Validate before calling

for name, cfg := range extConfig.TraceBackends {
    if err := cfg.Validate(); err != nil {
        return fmt.Errorf("trace storage '%s' invalid: %w", name, err)
    }
}

Try / catch

if err := ext.Start(ctx, host); err != nil {
    if strings.Contains(err.Error(), "invalid configuration for trace storage") {
        return fmt.Errorf("fix jaegerstorage trace backend config: %w", err)
    }
    return err
}

Prevention

When it happens

Trigger: storageExt.Start iterating s.config.TraceBackends; a backend's Validate() returns non-nil (e.g. multiple backend types set at once, none set, or invalid fields like bad Elasticsearch URLs or mutually exclusive options).

Common situations: Setting two backends (e.g. both cassandra and elasticsearch) for one named storage, leaving a backend entry empty, or invalid connection strings/auth settings in the traces backend config.

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


AI-assisted analysis of jaegertracing/jaeger@806f444784 (2026-09-01). Data as JSON: /api/errors/51a2b12fae20d8b4. Report an issue: GitHub.