{"record":{"id":"87df7463bc5475d7","repo":"jaegertracing/jaeger","slug":"storage-s-not-declared-in-s-extension-config","errorCode":null,"errorMessage":"storage '%s' not declared in '%s' extension configuration","messagePattern":"storage '(.+?)' not declared in '(.+?)' extension configuration","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/jaeger/internal/extension/jaegerstorage/extension.go","lineNumber":191,"sourceCode":"\t\t\t}\n\t\t}\n\t}\n\treturn errors.Join(errs...)\n}\n\nfunc (s *storageExt) TraceStorageFactory(name string) (tracestore.Factory, error) {\n\ts.factoryMu.Lock()\n\tdefer s.factoryMu.Unlock()\n\n\t// Return cached factory if already created\n\tif f, ok := s.factories[name]; ok {\n\t\treturn f, nil\n\t}\n\n\t// Check if configuration exists\n\tcfg, ok := s.config.TraceBackends[name]\n\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}","sourceCodeStart":173,"sourceCodeEnd":209,"githubUrl":"https://github.com/jaegertracing/jaeger/blob/806f4447841ecdb60519f408b004a599d515f437/cmd/jaeger/internal/extension/jaegerstorage/extension.go#L173-L209","documentation":"TraceStorageFactory lazily creates trace factories on demand. It first checks s.config.TraceBackends for the requested name; if the name was never declared in the jaegerstorage extension configuration, it returns this error naming both the storage and the component type. This catches references from other components (query, ingester, exporter) to storages that were never defined.","triggerScenarios":"Calling jaegerstorage.GetTraceStoreFactory(name, host) (or equivalent via getStorageFactory) with a name absent from the extension's TraceBackends map and not present in the cached factories map.","commonSituations":"Typo in the storage name in query.storage.* or exporter config, renaming a backend entry in jaegerstorage config without updating consumers, or referencing trace storage from a component whose name only exists under metric_backends.","solutions":["Declare the referenced storage name under the jaegerstorage extension's backends (TraceBackends) in the config","Fix the consumer's storage name to match an existing declared backend exactly","Keep names consistent between jaegerstorage backends and all referencing components; validate config before deploy"],"exampleFix":"// before: query references undeclared name\nservice:\n  extensions: [jaegerstorage]\nextensions:\n  jaegerstorage:\n    backends:\n      primary: { memory: {} }\n# query.storage.traces_main: \"main\"  -> not declared\n// after\n# query.storage.traces_main: \"primary\"  (matches declared backend)","handlingStrategy":"validation","validationCode":"// pre-check name against declared backends\nfunc hasTraceBackend(name string, cfg *jaegerstorage.Config) bool {\n    _, ok := cfg.TraceBackends[name]\n    return ok\n}","typeGuard":null,"tryCatchPattern":"f, err := jaegerstorage.GetTraceStoreFactory(name, host)\nif err != nil {\n    if strings.Contains(err.Error(), \"not declared in\") {\n        return fmt.Errorf(\"storage name '%s' must match a backend under jaegerstorage extensions config\", name)\n    }\n    return err\n}","preventionTips":["Use a shared constant/config variable for storage names across components","Diff consumer storage names against jaegerstorage backends in config linting","Rename backends and consumers together (search all `storage:` references)"],"tags":["go","jaeger","config","lookup"],"backgroundTag":"storage-not-declared","analyzedSha":"806f4447841ecdb60519f408b004a599d515f437","analyzedAt":"2026-09-01T02:39:22.140Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}