grpc/grpc-go · error
extproc: invalid response body mode
Error message
extproc: invalid response body mode %v: want %q or %q
What it means
Returned by validateBodyProcessingMode when ProcessingMode.response_body_mode is neither NONE nor GRPC. Same restriction as request body mode: grpc-go only implements NONE and GRPC for response bodies. Hit at ext_proc.go:100.
Solutions
- Set processing_mode.response_body_mode to NONE or GRPC.
- Use Envoy if you require STREAMED/BUFFERED response body processing.
- Verify the data plane is grpc-go and aligns the config to its supported subset.
- Pin and document the supported modes in your control-plane schema validation.
Example fix
# before processing_mode: response_body_mode: BUFFERED # after processing_mode: response_body_mode: GRPC
Defensive patterns
Strategy: validation
Validate before calling
// control-plane guard
allowed := map[int32]bool{0: true, 2: true}
if !allowed[int32(cfg.ProcessingMode.ResponseBodyMode.Number())] {
return fmt.Errorf("response_body_mode must be NONE or GRPC")
} Prevention
- Restrict response_body_mode to NONE or GRPC.
- Keep control-plane mode set aligned with grpc-go's supported subset.
- Document that STREAMED/BUFFERED need Envoy.
- Add a CI check on emitted xDS resources.
When it happens
Trigger: An xDS ExternalProcessor config sets processing_mode.response_body_mode to STREAMED or BUFFERED. validateBodyProcessingMode rejects it during ParseFilterConfig/ParseFilterConfigOverride.
Common situations: Config authored for Envoy's broader mode set; default mode changed to STREAMED by a control-plane upgrade; response-body inspection expected to work in streaming fashion.
Related errors
- extproc: invalid request body mode
- extproc: invalid response trailer mode
- external processor sent an immediate response but immediate…
- external processor unexpectedly sent request body when…
- external processor unexpectedly sent response body when…
AI-assisted analysis of grpc/grpc-go@0c51461d27 (2026-08-11).
Data as JSON: /api/errors/140c9ec0016e236d.
Report an issue: GitHub.
Appendix: source
Thrown at internal/xds/httpfilter/extproc/ext_proc.go:101
type builder struct{}
func (builder) TypeURLs() []string {
return []string{
"type.googleapis.com/envoy.extensions.filters.http.ext_proc.v3.ExternalProcessor",
"type.googleapis.com/envoy.extensions.filters.http.ext_proc.v3.ExtProcPerRoute",
}
}
// validateBodyProcessingMode ensures that the body processing mode is either
// NONE or GRPC. Also ensures that if response body mode is GRPC then response
// trailer mode must be SEND.
func validateBodyProcessingMode(mode *v3procfilterpb.ProcessingMode) error {
if m := mode.GetRequestBodyMode(); m != v3procfilterpb.ProcessingMode_NONE && m != v3procfilterpb.ProcessingMode_GRPC {
return fmt.Errorf("extproc: invalid request body mode %v: want %q or %q", m, "NONE", "GRPC")
}
if m := mode.GetResponseBodyMode(); m != v3procfilterpb.ProcessingMode_NONE && m != v3procfilterpb.ProcessingMode_GRPC {
return fmt.Errorf("extproc: invalid response body mode %v: want %q or %q", m, "NONE", "GRPC")
}
if mode.GetResponseBodyMode() == v3procfilterpb.ProcessingMode_GRPC && mode.GetResponseTrailerMode() != v3procfilterpb.ProcessingMode_SEND {
return fmt.Errorf("extproc: invalid response trailer mode %v: must be %q when response body mode is %q", mode.GetResponseTrailerMode(), "SEND", "GRPC")
}
return nil
}
func (builder) ParseFilterConfig(cfg proto.Message) (httpfilter.FilterConfig, error) {
m, ok := cfg.(*anypb.Any)
if !ok {
return nil, fmt.Errorf("extproc: error parsing config %v: unknown type %T, want *anypb.Any", cfg, cfg)
}
msg := new(v3procfilterpb.ExternalProcessor)
if err := m.UnmarshalTo(msg); err != nil {
return nil, fmt.Errorf("extproc: failed to unmarshal config %v: %v", cfg, err)
}
if msg.GetProcessingMode() == nil {
return nil, fmt.Errorf("extproc: missing processing_mode in config %v", cfg)View on GitHub (pinned to 0c51461d27)