{"record":{"id":"e49b275c08d3e279","repo":"jaegertracing/jaeger","slug":"failed-to-initialize-storage-s-w-e49b27","errorCode":null,"errorMessage":"failed to initialize storage '%s': %w","messagePattern":"failed to initialize storage '(.+?)': %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/jaeger/internal/extension/jaegerstorage/extension.go","lineNumber":208,"sourceCode":"\tif !ok {\n\t\treturn nil, fmt.Errorf(\n\t\t\t\"storage '%s' not declared in '%s' extension configuration\",\n\t\t\tname, componentType,\n\t\t)\n\t}\n\n\t// Create factory on demand\n\tfactory, err := storageconfig.CreateTraceStorageFactory(\n\t\tcontext.Background(),\n\t\tname,\n\t\tcfg,\n\t\ts.telset,\n\t\tfunc(authCfg config.Authentication, backendType, backendName string) (extensionauth.HTTPClient, error) {\n\t\t\treturn s.resolveAuthenticator(s.telset.Host, authCfg, backendType, backendName)\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to initialize storage '%s': %w\", name, err)\n\t}\n\n\ts.factories[name] = factory\n\treturn factory, nil\n}\n\n// createMetricStorageFactory is a helper function to create a metric storage factory\nfunc (s *storageExt) createMetricStorageFactory(name string, cfg storageconfig.MetricBackend, telset telemetry.Settings) (storage.MetricStoreFactory, error) {\n\tscopedMetricsFactory := func(name, kind, role string) metrics.Factory {\n\t\treturn telset.Metrics.Namespace(metrics.NSOptions{\n\t\t\tName: \"storage\",\n\t\t\tTags: map[string]string{\n\t\t\t\t\"name\": name,\n\t\t\t\t\"kind\": kind,\n\t\t\t\t\"role\": role,\n\t\t\t},\n\t\t})\n\t}","sourceCodeStart":190,"sourceCodeEnd":226,"githubUrl":"https://github.com/jaegertracing/jaeger/blob/806f4447841ecdb60519f408b004a599d515f437/cmd/jaeger/internal/extension/jaegerstorage/extension.go#L190-L226","documentation":"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'.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Inspect the wrapped inner error for the backend-specific cause and fix that configuration","Verify any `authentication.authenticator` referenced exists as an extension and implements extensionauth.HTTPClient","Confirm the backend type string is one supported by storageconfig.CreateTraceStorageFactory and matching dependencies are linked into the binary"],"exampleFix":"// before: authenticator not defined in extensions\nbackends:\n  es:\n    elasticsearch:\n      authentication:\n        authenticator: bearertoken  # extension missing\n// after\nextensions:\n  bearertokenauth/all:\n    token: \"...\"\n  jaegerstorage:\n    backends:\n      es:\n        elasticsearch:\n          authentication:\n            authenticator: bearertokenauth/all","handlingStrategy":"try-catch","validationCode":"// ensure referenced authenticator extensions exist before init\nfor _, authName := range collectAuthenticators(cfg) {\n    if _, ok := host.GetExtensions()[authName]; !ok {\n        return fmt.Errorf(\"authenticator extension %s not defined\", authName)\n    }\n}","typeGuard":null,"tryCatchPattern":"f, err := jaegerstorage.GetTraceStoreFactory(name, host)\nif err != nil {\n    var target *fmt.Errorf // inspect wrapped cause\n    if strings.Contains(err.Error(), \"failed to initialize storage\") {\n        return fmt.Errorf(\"backend '%s' init failed; see wrapped cause (authenticator, connection, driver)\", name)\n    }\n    return err\n}","preventionTips":["Define every referenced authenticator extension and verify it implements extensionauth.HTTPClient","Smoke-test backend connectivity (ES/Cassandra/ClickHouse) before startup","Keep backend type strings within the supported set in storageconfig"],"tags":["go","jaeger","storage","initialization"],"backgroundTag":"storage-init-failed","analyzedSha":"806f4447841ecdb60519f408b004a599d515f437","analyzedAt":"2026-09-01T02:39:22.140Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}