{"record":{"id":"2d908b0ed53851ab","repo":"grpc/grpc-go","slug":"rbac-incorrect-override-config-type-provided-t","errorCode":null,"errorMessage":"rbac: incorrect override config type provided (%T): %v","messagePattern":"rbac: incorrect override config type provided \\(%T\\): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/xds/httpfilter/rbac/rbac.go","lineNumber":188,"sourceCode":"\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\n\t}\n\treturn &interceptor{chainEngine: c.chainEngine}, nil\n}\n\ntype interceptor struct {\n\tchainEngine *rbac.ChainEngine\n}\n","sourceCodeStart":170,"sourceCodeEnd":206,"githubUrl":"https://github.com/grpc/grpc-go/blob/03255a9237b6eb32710f6bc4f2de9a675b99fe36/internal/xds/httpfilter/rbac/rbac.go#L170-L206","documentation":"When a per-route override is present, BuildServerInterceptor reassigns the config from the override and asserts it is the RBAC config type. A different type means an override produced by another filter builder was applied to the RBAC builder.","triggerScenarios":"A per-route typed_per_filter_config entry routes a non-RBAC override to the RBAC builder, or the override parsing produced the wrong concrete type.","commonSituations":"Per-route override keyed by the wrong filter name; override marshaling bug; TypeURL collision on overrides.","solutions":["Ensure the typed_per_filter_config entry is keyed by the RBAC filter name and parsed by the RBAC builder.","Verify no filter builders collide on the RBACPerRoute TypeURL."],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":"// Ensure the override was produced by the same (RBAC) builder before build.\n// At the resolver, track which builder parsed each FilterConfig and only pass\n// matching pairs to BuildServerInterceptor.","tryCatchPattern":null,"preventionTips":["Key typed_per_filter_config entries by the exact filter name.","Avoid TypeURL collisions across builders."],"tags":["rbac","xds","grpc","type-mismatch","per-route","internal-wiring"],"analyzedSha":"03255a9237b6eb32710f6bc4f2de9a675b99fe36","analyzedAt":"2026-08-07T00:29:34.215Z","schemaVersion":2},"datasetVersion":"2026-08-07T03:17:09.362Z"}