jaegertracing/jaeger · error

failed to initialize storage '%s': %w

Error message

failed to initialize storage '%s': %w

What it means

After confirming the storage name is declared, TraceStorageFactory calls storageconfig.CreateTraceStorageFactory to instantiate the backend factory, passing the telemetry settings and an authenticator resolver. Any failure inside backend construction (driver init, bad connection config, authenticator resolution) is wrapped as 'failed to initialize storage %s'.

Source

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

	if !ok {
		return nil, fmt.Errorf(
			"storage '%s' not declared in '%s' extension configuration",
			name, componentType,
		)
	}

	// Create factory on demand
	factory, err := storageconfig.CreateTraceStorageFactory(
		context.Background(),
		name,
		cfg,
		s.telset,
		func(authCfg config.Authentication, backendType, backendName string) (extensionauth.HTTPClient, error) {
			return s.resolveAuthenticator(s.telset.Host, authCfg, backendType, backendName)
		},
	)
	if err != nil {
		return nil, fmt.Errorf("failed to initialize storage '%s': %w", name, err)
	}

	s.factories[name] = factory
	return factory, nil
}

// createMetricStorageFactory is a helper function to create a metric storage factory
func (s *storageExt) createMetricStorageFactory(name string, cfg storageconfig.MetricBackend, telset telemetry.Settings) (storage.MetricStoreFactory, error) {
	scopedMetricsFactory := func(name, kind, role string) metrics.Factory {
		return telset.Metrics.Namespace(metrics.NSOptions{
			Name: "storage",
			Tags: map[string]string{
				"name": name,
				"kind": kind,
				"role": role,
			},
		})
	}

View on GitHub (pinned to 806f444784)

Solutions

  1. Inspect the wrapped inner error for the backend-specific cause and fix that configuration
  2. Verify any `authentication.authenticator` referenced exists as an extension and implements extensionauth.HTTPClient
  3. Confirm the backend type string is one supported by storageconfig.CreateTraceStorageFactory and matching dependencies are linked into the binary

Example fix

// before: authenticator not defined in extensions
backends:
  es:
    elasticsearch:
      authentication:
        authenticator: bearertoken  # extension missing
// after
extensions:
  bearertokenauth/all:
    token: "..."
  jaegerstorage:
    backends:
      es:
        elasticsearch:
          authentication:
            authenticator: bearertokenauth/all
Defensive patterns

Strategy: try-catch

Validate before calling

// ensure referenced authenticator extensions exist before init
for _, authName := range collectAuthenticators(cfg) {
    if _, ok := host.GetExtensions()[authName]; !ok {
        return fmt.Errorf("authenticator extension %s not defined", authName)
    }
}

Try / catch

f, err := jaegerstorage.GetTraceStoreFactory(name, host)
if err != nil {
    var target *fmt.Errorf // inspect wrapped cause
    if strings.Contains(err.Error(), "failed to initialize storage") {
        return fmt.Errorf("backend '%s' init failed; see wrapped cause (authenticator, connection, driver)", name)
    }
    return err
}

Prevention

When it happens

Trigger: TraceStorageFactory on first use of an uncached backend name; CreateTraceStorageFactory returns an error — e.g. invalid backend-specific config escaping Validate(), failure resolving the configured extensionauth authenticator, or driver/client constructor errors.

Common situations: Referenced authenticator extension missing from host or not implementing extensionauth.HTTPClient, bad Elasticsearch/Cassandra/ClickHouse connection parameters, or an unsupported backend type string in config.

Related errors


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