{"record":{"id":"140c9ec0016e236d","repo":"grpc/grpc-go","slug":"extproc-invalid-response-body-mode-v-want-q-or","errorCode":null,"errorMessage":"extproc: invalid response body mode %v: want %q or %q","messagePattern":"extproc: invalid response body mode (.+?): want %q or %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/xds/httpfilter/extproc/ext_proc.go","lineNumber":101,"sourceCode":"\ntype builder struct{}\n\nfunc (builder) TypeURLs() []string {\n\treturn []string{\n\t\t\"type.googleapis.com/envoy.extensions.filters.http.ext_proc.v3.ExternalProcessor\",\n\t\t\"type.googleapis.com/envoy.extensions.filters.http.ext_proc.v3.ExtProcPerRoute\",\n\t}\n}\n\n// validateBodyProcessingMode ensures that the body processing mode is either\n// NONE or GRPC. Also ensures that if response body mode is GRPC then response\n// trailer mode must be SEND.\nfunc validateBodyProcessingMode(mode *v3procfilterpb.ProcessingMode) error {\n\tif m := mode.GetRequestBodyMode(); m != v3procfilterpb.ProcessingMode_NONE && m != v3procfilterpb.ProcessingMode_GRPC {\n\t\treturn fmt.Errorf(\"extproc: invalid request body mode %v: want %q or %q\", m, \"NONE\", \"GRPC\")\n\t}\n\tif m := mode.GetResponseBodyMode(); m != v3procfilterpb.ProcessingMode_NONE && m != v3procfilterpb.ProcessingMode_GRPC {\n\t\treturn fmt.Errorf(\"extproc: invalid response body mode %v: want %q or %q\", m, \"NONE\", \"GRPC\")\n\t}\n\tif mode.GetResponseBodyMode() == v3procfilterpb.ProcessingMode_GRPC && mode.GetResponseTrailerMode() != v3procfilterpb.ProcessingMode_SEND {\n\t\treturn fmt.Errorf(\"extproc: invalid response trailer mode %v: must be %q when response body mode is %q\", mode.GetResponseTrailerMode(), \"SEND\", \"GRPC\")\n\t}\n\treturn nil\n}\n\nfunc (builder) ParseFilterConfig(cfg proto.Message) (httpfilter.FilterConfig, error) {\n\tm, ok := cfg.(*anypb.Any)\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"extproc: error parsing config %v: unknown type %T, want *anypb.Any\", cfg, cfg)\n\t}\n\tmsg := new(v3procfilterpb.ExternalProcessor)\n\tif err := m.UnmarshalTo(msg); err != nil {\n\t\treturn nil, fmt.Errorf(\"extproc: failed to unmarshal config %v: %v\", cfg, err)\n\t}\n\tif msg.GetProcessingMode() == nil {\n\t\treturn nil, fmt.Errorf(\"extproc: missing processing_mode in config %v\", cfg)","sourceCodeStart":83,"sourceCodeEnd":119,"githubUrl":"https://github.com/grpc/grpc-go/blob/0c51461d27177d997e14c642fe18c11668fc09a3/internal/xds/httpfilter/extproc/ext_proc.go#L83-L119","documentation":"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.","triggerScenarios":"An xDS ExternalProcessor config sets processing_mode.response_body_mode to STREAMED or BUFFERED. validateBodyProcessingMode rejects it during ParseFilterConfig/ParseFilterConfigOverride.","commonSituations":"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.","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."],"exampleFix":"# before\nprocessing_mode:\n  response_body_mode: BUFFERED\n# after\nprocessing_mode:\n  response_body_mode: GRPC","handlingStrategy":"validation","validationCode":"// control-plane guard\nallowed := map[int32]bool{0: true, 2: true}\nif !allowed[int32(cfg.ProcessingMode.ResponseBodyMode.Number())] {\n  return fmt.Errorf(\"response_body_mode must be NONE or GRPC\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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."],"tags":["grpc","xds","extproc","config","processing-mode"],"backgroundTag":null,"analyzedSha":"0c51461d27177d997e14c642fe18c11668fc09a3","analyzedAt":"2026-08-11T14:49:15.055Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}