{"record":{"id":"159c2b73c098cb33","repo":"grpc/grpc-go","slug":"external-processor-returned-unexpected-status-v-f-159c2b","errorCode":null,"errorMessage":"external processor returned unexpected status %v for body response, expected %v","messagePattern":"external processor returned unexpected status (.+?) for body response, expected (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/xds/httpfilter/extproc/ext_proc.go","lineNumber":1358,"sourceCode":"\t\t\tif cs.responseTrailerReady.HasFired() {\n\t\t\t\tcs.failProcStream(fmt.Errorf(\"external processor unexpectedly sent duplicate response trailers after response trailers were already processed\"))\n\t\t\t\treturn\n\t\t\t}\n\t\t\ttrailer := resp.GetResponseTrailers()\n\t\t\tif err = cs.applyMutations(trailer.GetHeaderMutation(), cs.responseTrailers); err != nil {\n\t\t\t\tcs.failProcStream(err)\n\t\t\t\treturn\n\t\t\t}\n\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}","sourceCodeStart":1340,"sourceCodeEnd":1376,"githubUrl":"https://github.com/grpc/grpc-go/blob/03255a9237b6eb32710f6bc4f2de9a675b99fe36/internal/xds/httpfilter/extproc/ext_proc.go#L1340-L1376","documentation":"When validating a body response from the extproc server, the filter requires the CommonResponse status to be CONTINUE (ext_proc.go:1357). Any other status value means the server is not cleanly continuing the stream; the filter refuses to apply the body mutation and fails the proc stream.","triggerScenarios":"The external processor returns a ProcessingResponse with a body response whose CommonResponse.Status is anything other than CONTINUE (e.g. an unset/zero status or a custom enum value).","commonSituations":"Extproc server sets status incorrectly on body messages; server code path that constructs body responses without setting Status=CONTINUE; protobuf version drift exposing a new status enum value the client rejects.","solutions":["Ensure the extproc server sets response.status = CONTINUE on every body ProcessingResponse it sends.","If the server intends to reject, it should use an ImmediateResponse rather than a non-CONTINUE body status.","Enable failure_mode_allow to tolerate the server error while debugging."],"exampleFix":"// before\nbodyResp.Response.Status = procservicepb.CommonResponse_REPLY\n\n// after\nbodyResp.Response.Status = procservicepb.CommonResponse_CONTINUE","handlingStrategy":"fallback","validationCode":"// Server side: assert before sending\nif bodyResp.GetResponse().GetStatus() != procservicepb.CommonResponse_CONTINUE {\n    bodyResp.Response.Status = procservicepb.CommonResponse_CONTINUE\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always set Status=CONTINUE on body responses in the extproc server.","Use ImmediateResponse, not a non-CONTINUE status, to reject.","Set failure_mode_allow during server development."],"tags":["extproc","grpc","xds","protocol","go"],"analyzedSha":"03255a9237b6eb32710f6bc4f2de9a675b99fe36","analyzedAt":"2026-08-07T00:29:34.215Z","schemaVersion":2},"datasetVersion":"2026-08-07T03:17:09.362Z"}