grpc/grpc-go · error

extproc: invalid response body mode %v: want %q or %q

Error message

extproc: invalid response body mode %v: want %q or %q

What it means

Raised by validateBodyProcessingMode (ext_proc.go:101) when processing_mode.response_body_mode is anything other than NONE or GRPC. Same restriction as error 372 applied to the response direction: gRPC's ext_proc only supports NONE and GRPC response body modes.

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 03255a9237)

Solutions

  1. Set response_body_mode to NONE or GRPC.
  2. Strip unsupported body modes when adapting an Envoy config for gRPC consumption.
  3. Redeploy and verify the resource is ACKed.

Example fix

// before
//   processing_mode: { response_body_mode: BUFFERED }   // -> error 373
//
// after
//   processing_mode: { response_body_mode: GRPC }   // (or NONE)
Defensive patterns

Strategy: validation

Validate before calling

// Validate response body mode (ext_proc.go:100-102).
func validateResponseBodyMode(pm *v3procfilterpb.ProcessingMode) error {
    if m := pm.GetResponseBodyMode(); m != v3procfilterpb.ProcessingMode_NONE && m != v3procfilterpb.ProcessingMode_GRPC {
        return fmt.Errorf("extproc: invalid response body mode %v: want %%q or %%q", m)
    }
    return nil
}

Prevention

When it happens

Trigger: msg.GetProcessingMode().GetResponseBodyMode() returns a value other than NONE or GRPC at ext_proc.go:100.

Common situations: An Envoy HTTP ext_proc config with response_body_mode: STREAMED/BUFFERED is fed to a gRPC client unchanged; a templated config defaulting response_body_mode to a non-supported value.

Related errors


AI-assisted analysis of grpc/grpc-go@03255a9237 (2026-08-07). Data as JSON: /api/errors/140c9ec0016e236d. Report an issue: GitHub.