{"record":{"id":"6de6bbfff7240dff","repo":"grpc/grpc-go","slug":"external-processor-returned-compressed-grpc-messag","errorCode":null,"errorMessage":"external processor returned compressed grpc message which is not supported","messagePattern":"external processor returned compressed grpc message which is not supported","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/xds/httpfilter/extproc/ext_proc.go","lineNumber":1367,"sourceCode":"\t\t\t// Signal that the response trailer is modified and ready to be sent to\n\t\t\t// the client.\n\t\t\tcs.fireResponseTrailerReady()\n\t\t}\n\t}\n}\n\nfunc (cs *clientStream) validateBodyResponse(bodyResp *v3procservicepb.BodyResponse) (*v3procservicepb.StreamedBodyResponse, bool) {\n\tif status := bodyResp.GetResponse().GetStatus(); status != v3procservicepb.CommonResponse_CONTINUE {\n\t\tcs.failProcStream(fmt.Errorf(\"external processor returned unexpected status %v for body response, expected %v\", status, v3procservicepb.CommonResponse_CONTINUE))\n\t\treturn nil, false\n\t}\n\tstreamedResp := bodyResp.GetResponse().GetBodyMutation().GetStreamedResponse()\n\tif streamedResp == nil {\n\t\tcs.failProcStream(fmt.Errorf(\"external processor returned invalid body mutation in body response\"))\n\t\treturn nil, false\n\t}\n\tif streamedResp.GetGrpcMessageCompressed() {\n\t\tcs.failProcStream(fmt.Errorf(\"external processor returned compressed grpc message which is not supported\"))\n\t\treturn nil, false\n\t}\n\treturn streamedResp, true\n}\n\nfunc (cs *clientStream) applyMutations(mutation *v3procservicepb.HeaderMutation, md metadata.MD) error {\n\tif mutation == nil {\n\t\treturn nil\n\t}\n\tif err := cs.config.mutationRules.ApplyAdditions(mutation.GetSetHeaders(), md); err != nil {\n\t\treturn err\n\t}\n\treturn cs.config.mutationRules.ApplyRemovals(mutation.GetRemoveHeaders(), md)\n}\n\n// closeProcSend gracefully half-closes the external processor stream across the\n// background send goroutine by pushing a nil sentinel onto procSendCh.\nfunc (cs *clientStream) closeProcSend() {","sourceCodeStart":1349,"sourceCodeEnd":1385,"githubUrl":"https://github.com/grpc/grpc-go/blob/03255a9237b6eb32710f6bc4f2de9a675b99fe36/internal/xds/httpfilter/extproc/ext_proc.go#L1349-L1385","documentation":"grpc-go's extproc filter does not support receiving gRPC messages that are marked compressed by the external processor (ext_proc.go:1366). The StreamedBodyResponse.grpc_message_compressed flag must be false; otherwise the filter fails the stream because it cannot handle a compressed payload in this code path.","triggerScenarios":"The extproc server sets StreamedBodyResponse.grpc_message_compressed = true on a body response.","commonSituations":"Server copies a compressed response directly into the chunk and flags it compressed; misunderstanding the contract where the extproc layer is expected to deliver uncompressed chunks for grpc-go to (re)compress itself.","solutions":["Set grpc_message_compressed = false on all StreamedBodyResponse messages from the extproc server.","Decompress the chunk before placing it in StreamedBodyResponse so the flag can stay false.","If compression is required end-to-end, configure it at the gRPC channel/compression level, not via the extproc flag."],"exampleFix":"// before\nstreamedResp.GrpcMessageCompressed = true\n\n// after\nstreamedResp.GrpcMessageCompressed = false","handlingStrategy":"validation","validationCode":"// Server side: clear the flag before sending\nif streamedResp.GetGrpcMessageCompressed() {\n    streamedResp.GrpcMessageCompressed = false\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["grpc-go does not accept compressed gRPC messages from extproc; keep the flag false.","Decompress chunks server-side if you need to inspect them.","Configure compression at the channel level, not via the extproc flag."],"tags":["extproc","grpc","xds","compression","protocol","go"],"analyzedSha":"03255a9237b6eb32710f6bc4f2de9a675b99fe36","analyzedAt":"2026-08-07T00:29:34.215Z","schemaVersion":2},"datasetVersion":"2026-08-07T03:17:09.362Z"}