grpc/grpc-go · error
fault: incorrect config type provided (%T)
Error message
fault: incorrect config type provided (%T): %v
What it means
BuildClientInterceptor (fault.go:124) requires cfg to be the filter's internal config struct (the unexported type returned by parseConfig). Any other concrete type fails the assertion — usually because a config from a different filter builder was passed in.
Solutions
- Use the config value returned by the fault builder's ParseFilterConfig as the cfg argument.
- Do not mix configs across filter builders; each builder produces its own internal type.
- Add a unit test that asserts the cfg type matches the builder that produced it.
Example fix
// before ic, err := faultCF.BuildClientInterceptor(rbacConfig, override) // after ic, err := faultCF.BuildClientInterceptor(faultConfig, override)
Defensive patterns
Strategy: type-guard
Validate before calling
// Internal type is unexported, so guard by ensuring the same builder produced cfg. // Caller-side: keep a reference to the builder and use it for both parse and build.
Try / catch
// The error is returned from BuildClientInterceptor; surface it during filter setup.
ic, err := cf.BuildClientInterceptor(cfg, override)
if err != nil && strings.Contains(err.Error(), "incorrect config type") {
// re-parse cfg with the correct builder
} Prevention
- Never substitute a config produced by one builder into another builder's filter.
- Keep parse and build calls paired through the same builder instance.
When it happens
Trigger: BuildClientInterceptor is called with a FilterConfig value that is not the fault filter's internal config struct (e.g., an rbac or gcp_authn config, or a custom implementation of the FilterConfig interface).
Common situations: Cross-filter wiring mistake; a wrapper that re-implements httpfilter.FilterConfig and passes its own type; refactoring that swapped builders.
Related errors
- fault: error parsing config
- fault: incorrect override config type provided (%T)
- fault: error parsing config
- fault: nil config provided
- fault: nil configuration message provided
AI-assisted analysis of grpc/grpc-go@0c51461d27 (2026-08-11).
Data as JSON: /api/errors/02a6498a2b5cf709.
Report an issue: GitHub.
Appendix: source
Thrown at internal/xds/httpfilter/fault/fault.go:125
func (builder) BuildClientFilter(httpfilter.ClientFilterOptions) httpfilter.ClientFilter {
return clientFilter{}
}
var _ httpfilter.ClientFilterBuilder = builder{}
type clientFilter struct{}
func (clientFilter) Close() {}
func (clientFilter) BuildClientInterceptor(cfg, override httpfilter.FilterConfig) (httpfilter.ClientInterceptor, error) {
if cfg == nil {
return nil, fmt.Errorf("fault: nil config provided")
}
c, ok := cfg.(config)
if !ok {
return nil, fmt.Errorf("fault: incorrect config type provided (%T): %v", cfg, cfg)
}
if override != nil {
// override completely replaces the listener configuration; but we
// still validate the listener config type.
c, ok = override.(config)
if !ok {
return nil, fmt.Errorf("fault: incorrect override config type provided (%T): %v", override, override)
}
}
icfg := c.config
if (icfg.GetMaxActiveFaults() != nil && icfg.GetMaxActiveFaults().GetValue() == 0) ||
(icfg.GetDelay() == nil && icfg.GetAbort() == nil) {
return nil, nil
}
return &interceptor{config: icfg}, nil
}View on GitHub (pinned to 0c51461d27)