{"record":{"id":"80f6059e8be76914","repo":"hasura/graphql-engine","slug":"error-while-building-the-request-for-the-pre-respo","errorCode":null,"errorMessage":"Error while building the request for the pre-response plugin {0} - {1}","messagePattern":"Error while building the request for the pre-response plugin (.+?) - (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"v3/crates/plugins/pre-ndc-response-plugin/src/execute.rs","lineNumber":18,"sourceCode":"use axum::http::HeaderName;\nuse engine_types::HttpContext;\nuse hasura_authn_core::{Role, Session, SessionVariableName};\nuse metadata_resolve::{DataConnectorLink, Qualified, ResolvedLifecyclePreNdcResponsePluginHook};\nuse open_dds::data_connector::DataConnectorName;\nuse reqwest::{\n    Client,\n    header::{InvalidHeaderName, InvalidHeaderValue},\n};\nuse serde::{Deserialize, Serialize};\nuse std::{collections::BTreeMap, str::FromStr, sync::Arc};\nuse tracing_util::{ErrorVisibility, SpanVisibility, TraceableError, set_attribute_on_active_span};\n\n#[derive(Debug, thiserror::Error)]\npub enum Error {\n    #[error(\"Error while making the HTTP request to the pre-response plugin {0} - {1}\")]\n    ErrorWhileMakingHTTPRequestToTheHook(String, reqwest::Error),\n    #[error(\"Error while building the request for the pre-response plugin {0} - {1}\")]\n    BuildRequestError(String, #[source] BuildRequestError),\n    #[error(\"Reqwest error: {0}\")]\n    ReqwestError(reqwest::Error),\n    #[error(\"Unexpected status code: {0}\")]\n    UnexpectedStatusCode(u16),\n    #[error(\"Error parsing the request: {0}\")]\n    PluginRequestParseError(serde_json::error::Error),\n    #[error(\"Internal error from plugin {plugin_name}\")]\n    PluginInternalError {\n        plugin_name: String,\n        error: serde_json::Value,\n    },\n    #[error(\"User error from plugin {plugin_name}\")]\n    PluginUserError {\n        plugin_name: String,\n        error: serde_json::Value,\n    },\n}","sourceCodeStart":1,"sourceCodeEnd":36,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/v3/crates/plugins/pre-ndc-response-plugin/src/execute.rs#L1-L36","documentation":"The engine failed while constructing the HTTP request it sends to the pre-NDC-response plugin — before any network activity. The wrapped BuildRequestError details the exact cause: invalid header name, invalid header value, session conversion problems, or serialization failure. The plugin name is included for context.","triggerScenarios":"Config of the response plugin references headers or session variables that fail conversion, or the response payload cannot be serialized, while building the outgoing webhook request.","commonSituations":"Malformed forwarded-header config; session variables with unexpected shapes after an auth change; engine/plugin version skew altering the wire format.","solutions":["Look at the wrapped BuildRequestError source to identify the real cause (header/session/serialization)","Fix the offending config value or session variable as indicated by the inner error","Re-deploy plugin and engine at matching versions","Validate plugin config in CI with a schema check before rollout"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// validate all forwarded header names/values and session vars before enabling the hook\nconfig.forward_headers.iter().for_each(|(k, v)| { assert!(valid_header_name(k)); assert!(ascii_header_value(v)); });","typeGuard":null,"tryCatchPattern":"if let Err(Error::BuildRequestError(name, inner)) = res {\n    tracing::error!(plugin = name, inner = ?inner, \"hook request build failed\");\n}","preventionTips":["Schema-validate plugin config in CI","Smoke-test a request through every configured hook after deploys"],"tags":["rust","plugin","configuration","http"],"backgroundTag":"webhook-request-build-failed","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}