{"record":{"id":"21d05b602a019dbc","repo":"grpc/grpc-go","slug":"rbac-incorrect-config-type-provided-t-v","errorCode":null,"errorMessage":"rbac: incorrect config type provided (%T): %v","messagePattern":"rbac: incorrect config type provided \\(%T\\): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/xds/httpfilter/rbac/rbac.go","lineNumber":180,"sourceCode":"\nfunc (builder) BuildServerFilter() httpfilter.ServerFilter {\n\treturn serverFilter{}\n}\n\nvar _ httpfilter.ServerFilterBuilder = builder{}\n\ntype serverFilter struct{}\n\nfunc (serverFilter) Close() {}\n\nfunc (serverFilter) BuildServerInterceptor(cfg httpfilter.FilterConfig, override httpfilter.FilterConfig) (resolver.ServerInterceptor, error) {\n\tif cfg == nil {\n\t\treturn nil, fmt.Errorf(\"rbac: nil config provided\")\n\t}\n\n\tc, ok := cfg.(config)\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"rbac: incorrect config type provided (%T): %v\", cfg, cfg)\n\t}\n\n\tif override != nil {\n\t\t// override completely replaces the listener configuration; but we\n\t\t// still validate the listener config type.\n\t\tc, ok = override.(config)\n\t\tif !ok {\n\t\t\treturn nil, fmt.Errorf(\"rbac: incorrect override config type provided (%T): %v\", override, override)\n\t\t}\n\t}\n\n\t// RBAC HTTP Filter is a no op from one of these two cases:\n\t// \"If absent, no enforcing RBAC policy will be applied\" - RBAC\n\t// Documentation for Rules field.\n\t// \"At this time, if the RBAC.action is Action.LOG then the policy will be\n\t// completely ignored, as if RBAC was not configured.\" - A41\n\tif c.chainEngine == nil {\n\t\treturn nil, nil","sourceCodeStart":162,"sourceCodeEnd":198,"githubUrl":"https://github.com/grpc/grpc-go/blob/03255a9237b6eb32710f6bc4f2de9a675b99fe36/internal/xds/httpfilter/rbac/rbac.go#L162-L198","documentation":"BuildServerInterceptor asserts the listener-level config is the RBAC builder's own unexported config struct. A different concrete type means a config produced by another filter builder was dispatched into the RBAC builder.","triggerScenarios":"The httpfilter registry hands a non-RBAC config to the RBAC BuildServerInterceptor - e.g. two filters share or collide on a TypeURL, or the filter chain was misrouted.","commonSituations":"Filter misregistration; TypeURL collision between custom and built-in filters; internal dispatch bug.","solutions":["Confirm no two registered httpfilter builders advertise the same TypeURL.","Ensure the builder that produced the config is the RBAC builder (check httpfilter registration order and TypeURLs)."],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":"// Inside the rbac package the config type is unexported; outside callers\n// can only assert via the httpfilter.FilterConfig interface. Ensure the same\n// builder that parsed the config also builds the interceptor.\nfunc sameBuilder(parsedBy, buildBy httpfilter.Builder) bool { return parsedBy == buildBy }","tryCatchPattern":null,"preventionTips":["Never share TypeURLs between registered httpfilter builders.","Keep parse and build of a filter on the same builder instance."],"tags":["rbac","xds","grpc","type-mismatch","internal-wiring"],"analyzedSha":"03255a9237b6eb32710f6bc4f2de9a675b99fe36","analyzedAt":"2026-08-07T00:29:34.215Z","schemaVersion":2},"datasetVersion":"2026-08-07T03:17:09.362Z"}