{"record":{"id":"5933f0fdd0e5b197","repo":"jaegertracing/jaeger","slug":"extension-s-is-not-of-expected-type-s","errorCode":null,"errorMessage":"extension '%s' is not of expected type '%s'","messagePattern":"extension '(.+?)' is not of expected type '(.+?)'","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/jaeger/internal/extension/jaegerstorage/extension.go","lineNumber":119,"sourceCode":"\nfunc findExtension(host component.Host) (Extension, error) {\n\tvar id component.ID\n\tvar comp component.Component\n\tfor i, ext := range host.GetExtensions() {\n\t\tif i.Type() == componentType {\n\t\t\tid, comp = i, ext\n\t\t\tbreak\n\t\t}\n\t}\n\tif comp == nil {\n\t\treturn nil, fmt.Errorf(\n\t\t\t\"cannot find extension '%s' (make sure it's defined earlier in the config)\",\n\t\t\tcomponentType,\n\t\t)\n\t}\n\text, ok := comp.(Extension)\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"extension '%s' is not of expected type '%s'\", id, componentType)\n\t}\n\treturn ext, nil\n}\n\nfunc newStorageExt(cfg *Config, telset component.TelemetrySettings) *storageExt {\n\t// Initialize telemetry.Settings with host=nil, will be set in Start()\n\ttset := telemetry.Settings{\n\t\tLogger:         telset.Logger,\n\t\tMeterProvider:  telset.MeterProvider,\n\t\tTracerProvider: telset.TracerProvider,\n\t}\n\treturn &storageExt{\n\t\tconfig:           cfg,\n\t\ttelset:           tset,\n\t\tfactories:        make(map[string]tracestore.Factory),\n\t\tmetricsFactories: make(map[string]storage.MetricStoreFactory),\n\t}\n}","sourceCodeStart":101,"sourceCodeEnd":137,"githubUrl":"https://github.com/jaegertracing/jaeger/blob/806f4447841ecdb60519f408b004a599d515f437/cmd/jaeger/internal/extension/jaegerstorage/extension.go#L101-L137","documentation":"After findExtension locates a component whose type matches the jaegerstorage componentType, it type-asserts it to the package's Extension interface. If the registered component has the right type name but does not implement Extension (TraceStorageFactory/MetricStorageFactory/Start/Shutdown), this error is thrown.","triggerScenarios":"findExtension (reached via getStorageFactory or GetMetricStorageFactory) iterating host.GetExtensions() finds a component with matching component.ID type whose concrete value does not satisfy the Extension interface.","commonSituations":"A custom or vendored extension registered under the same component type string but with an incompatible implementation, or a version mismatch where an older jaegerstorage build lacking the current interface is registered.","solutions":["Ensure the jaegerstorage extension from the same jaeger version is the one registered (rebuild binary with matching imports)","If a custom extension reuses the component type, make it implement the full Extension interface (extension.Extension + TraceStorageFactory + MetricStorageFactory)","Check for duplicate/conflicting extension registrations in the collector build"],"exampleFix":"// before: custom component missing interface methods\nfunc (e *myExt) Start(ctx context.Context, h component.Host) error { ... }\n// after: also satisfy Extension\nvar _ Extension = (*myExt)(nil)\nfunc (e *myExt) TraceStorageFactory(name string) (tracestore.Factory, error) { ... }\nfunc (e *myExt) MetricStorageFactory(name string) (storage.MetricStoreFactory, error) { ... }","handlingStrategy":"type-guard","validationCode":null,"typeGuard":"func asStorageExtension(c component.Component) (jaegerstorage.Extension, bool) {\n    ext, ok := c.(jaegerstorage.Extension)\n    return ext, ok\n}","tryCatchPattern":"ext, err := findExtension(host)\nif err != nil {\n    if strings.Contains(err.Error(), \"is not of expected type\") {\n        return fmt.Errorf(\"build mismatch: registered jaegerstorage extension lacks current interface; rebuild with matching jaeger version: %w\", err)\n    }\n    return err\n}","preventionTips":["Compile-time interface checks: `var _ Extension = (*storageExt)(nil)`","Avoid registering custom components under the jaegerstorage component type","Keep jaeger module versions consistent across the binary"],"tags":["go","jaeger","type-assertion","otel-collector"],"backgroundTag":"interface-not-implemented","analyzedSha":"806f4447841ecdb60519f408b004a599d515f437","analyzedAt":"2026-09-01T02:39:22.140Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}