{"record":{"id":"7dc3fba88344fb4b","repo":"grpc/grpc-go","slug":"extproc-incorrect-config-type-provided-t-v","errorCode":null,"errorMessage":"extproc: incorrect config type provided (%T): %v","messagePattern":"extproc: incorrect config type provided \\(%T\\): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/xds/httpfilter/extproc/ext_proc.go","lineNumber":238,"sourceCode":"\treturn &clientFilter{\n\t\tmetricsRecorder: opts.MetricsRecorder,\n\t\ttarget:          opts.Target,\n\t}\n}\n\nvar _ httpfilter.ClientFilterBuilder = builder{}\n\ntype clientFilter struct {\n\tmetricsRecorder estats.MetricsRecorder\n\ttarget          string\n}\n\nfunc (clientFilter) Close() {}\n\nfunc (cf *clientFilter) BuildClientInterceptor(base, override httpfilter.FilterConfig) (httpfilter.ClientInterceptor, error) {\n\tb, ok := base.(baseConfig)\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"extproc: incorrect config type provided (%T): %v\", base, base)\n\t}\n\n\tvar ov overrideConfig\n\tif override != nil {\n\t\tov, ok = override.(overrideConfig)\n\t\tif !ok {\n\t\t\treturn nil, fmt.Errorf(\"extproc: incorrect override config type provided (%T): %v\", override, override)\n\t\t}\n\t}\n\n\tconfig := newInterceptorConfig(b, ov)\n\n\t// Create a channel to the external processor server.\n\tcc, cancel, err := iextproc.CreateExtProcChannel(config.server)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"extproc: failed to create channel to the external processor server %q: %v\", config.server.TargetURI, err)\n\t}\n\treturn &clientInterceptor{","sourceCodeStart":220,"sourceCodeEnd":256,"githubUrl":"https://github.com/grpc/grpc-go/blob/03255a9237b6eb32710f6bc4f2de9a675b99fe36/internal/xds/httpfilter/extproc/ext_proc.go#L220-L256","documentation":"Raised by BuildClientInterceptor when the base filter config handed to it is not the internal baseConfig type produced by ParseFilterConfig. The builder pipeline guarantees that ParseFilterConfig returns a baseConfig; any other concrete type indicates the httpfilter framework handed back an unexpected value.","triggerScenarios":"BuildClientInterceptor is invoked with a base FilterConfig produced by a different filter's ParseFilterConfig (registry/type-URL collision), or a test constructs a clientFilter and calls BuildClientInterceptor with an arbitrary httpfilter.FilterConfig value.","commonSituations":"Two filters registered under overlapping TypeURLs. A test that fakes base config with a struct that does not equal baseConfig. A refactor of baseConfig that left an old type still being passed.","solutions":["Ensure base originates from extproc's ParseFilterConfig (returns baseConfig) and not from another filter's builder.","In tests, pass a real baseConfig value rather than a mock FilterConfig.","Check for TypeURL collisions in the httpfilter registry and that the extproc builder is the one handling type type.googleapis.com/envoy.extensions.filters.http.ext_proc.v3.ExternalProcessor."],"exampleFix":"// before (test): wrong base type\ncf := clientFilter{}\ncf.BuildClientInterceptor(mockConfig{}, nil)\n\n// after\ncf := clientFilter{}\ncf.BuildClientInterceptor(baseConfig{server: srv, processingModes: pm}, nil)","handlingStrategy":"type-guard","validationCode":"// In tests, assert the base config is the extproc baseConfig.\nfunc mustBuild(cf httpfilter.ClientFilter, base, ov httpfilter.FilterConfig) (httpfilter.ClientInterceptor, error) {\n    if _, ok := base.(baseConfig); !ok {\n        return nil, fmt.Errorf(\"base not extproc baseConfig: %T\", base)\n    }\n    return cf.BuildClientInterceptor(base, ov)\n}","typeGuard":"func isBaseConfig(c httpfilter.FilterConfig) bool { _, ok := c.(baseConfig); return ok }","tryCatchPattern":null,"preventionTips":["Always source base config from extproc's ParseFilterConfig.","Avoid registering two builders under the same TypeURL."],"tags":["extproc","xds","config-parsing","type-mismatch","internal-invariant"],"analyzedSha":"03255a9237b6eb32710f6bc4f2de9a675b99fe36","analyzedAt":"2026-08-07T00:29:34.215Z","schemaVersion":2},"datasetVersion":"2026-08-07T03:17:09.362Z"}