{"record":{"id":"e762fa408a213042","repo":"hasura/graphql-engine","slug":"error-in-executing-pre-response-plugins-0","errorCode":null,"errorMessage":"error in executing pre-response plugins: {0}","messagePattern":"error in executing pre-response plugins: (.+?)","errorType":"exception","errorClass":"ExecutePreResponsePluginsError","httpStatus":null,"severity":"error","filePath":"v3/crates/graphql/graphql-ws/src/protocol/subscribe.rs","lineNumber":755,"sourceCode":"                    }\n                }\n            }\n            GraphQLResponseOrCustomResponse::CustomResponse(bytes) => {\n                connection\n                    .send(ws::Message::Raw(axum::extract::ws::Message::Binary(bytes)))\n                    .await;\n            }\n        }\n    }\n    stop_subscription\n}\n\n#[derive(thiserror::Error, Debug)]\n#[error(\"error in executing pre-response plugins, unable to encode response: {0}\")]\nenum ExecutePreResponsePluginsError {\n    #[error(\"error in executing pre-response plugins, unable to encode response: {0}\")]\n    EncodeError(#[from] serde_json::Error),\n    #[error(\"error in executing pre-response plugins: {0}\")]\n    PreResponsePluginError(#[from] pre_response_plugin::Error),\n}\n\nimpl tracing_util::TraceableError for ExecutePreResponsePluginsError {\n    fn visibility(&self) -> tracing_util::ErrorVisibility {\n        tracing_util::ErrorVisibility::User\n    }\n}\n\nasync fn run_pre_response_plugins<M: WebSocketMetrics>(\n    client_address: std::net::SocketAddr,\n    raw_request: &lang_graphql::http::RawRequest,\n    session: Session,\n    headers: http::HeaderMap,\n    response: &lang_graphql::http::Response,\n    connection: &ws::Connection<M>,\n) -> Result<PreResponsePluginResponse, GraphQLResponse> {\n    // Execute pre-response plugins only if there are any","sourceCodeStart":737,"sourceCodeEnd":773,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/v3/crates/graphql/graphql-ws/src/protocol/subscribe.rs#L737-L773","documentation":"A pre-response plugin itself returned an error while processing a subscription response (`pre_response_plugin::Error`), wrapped as `ExecutePreResponsePluginsError::PreResponsePluginError`. These plugins run on every response before it is sent to the subscriber; any plugin failure aborts delivery.","triggerScenarios":"Registering a pre-response plugin (metric enrichment, redaction, response transformation) whose execute() returns Err when handling a subscription payload — e.g. missing context keys it expects, downstream service call failure, or internal validation failure.","commonSituations":"Plugin expecting a context/field the new codebase no longer provides; plugin calling an external service that is down; plugin version mismatch after upgrading the graphql platform.","solutions":["Check server logs for the inner pre_response_plugin::Error to identify the failing plugin and cause","Fix or reconfigure the failing plugin (context keys, external endpoints, auth for its calls)","If the plugin is non-critical, consider making its errors non-fatal or disabling it","Add integration tests covering the plugin chain for subscription responses"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"catch (e) { if (String(e).includes('pre-response plugins')) { send unmodified response as fallback and alert; } }","preventionTips":["Make non-critical plugins non-fatal where supported","Integration-test the full plugin chain","Version-lock plugins with the graphql platform release"],"tags":["graphql-ws","plugins","response-processing","subscriptions"],"backgroundTag":"graphql-plugin-rejected-request","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}