{"record":{"id":"806c34a6e07a86b2","repo":"hasura/graphql-engine","slug":"error-while-building-the-request-for-the-pre-parse-806c34","errorCode":null,"errorMessage":"Error while building the request for the pre-parse plugin {0} - {1}","messagePattern":"Error while building the request for the pre-parse plugin (.+?) - (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"v3/crates/plugins/pre-response-plugin/src/execute/common.rs","lineNumber":19,"sourceCode":"use std::{collections::BTreeMap, str::FromStr};\n\nuse axum::{\n    http::{HeaderMap, HeaderName, StatusCode},\n    response::IntoResponse,\n};\n\nuse hasura_authn_core::Session;\nuse lang_graphql::{ast::common as ast, http::RawRequest};\nuse open_dds::plugins::{LifecyclePluginUrl, LifecyclePreResponsePluginHookConfigRequest};\nuse reqwest::header::HeaderValue;\nuse serde::Serialize;\nuse tracing_util::{ErrorVisibility, TraceableError};\n\n#[derive(Debug, thiserror::Error)]\npub enum Error {\n    #[error(\"Error while making the HTTP request to the pre-parse plugin {0} - {1}\")]\n    ErrorWhileMakingHTTPRequestToTheHook(String, reqwest::Error),\n    #[error(\"Error while building the request for the pre-parse plugin {0} - {1}\")]\n    BuildRequestError(String, String),\n    #[error(\"Reqwest error: {0}\")]\n    ReqwestError(reqwest::Error),\n    #[error(\"Error parsing the request: {0}\")]\n    PluginRequestParseError(serde_json::Error),\n    #[error(\"Error parsing the engine response: {0}\")]\n    EngineResponseParseError(serde_json::Error),\n    #[error(\"Unexpected status code: {0}\")]\n    UnexpectedStatusCode(u16),\n    #[error(\"Error serializing the modified response: {0}\")]\n    ResponseSerializationError(serde_json::Error),\n    #[error(\"Error while preparing the response: {0}\")]\n    ResponsePreparationError(axum::http::Error),\n}\n\nimpl TraceableError for Error {\n    fn visibility(&self) -> ErrorVisibility {\n        ErrorVisibility::Internal","sourceCodeStart":1,"sourceCodeEnd":37,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/v3/crates/plugins/pre-response-plugin/src/execute/common.rs#L1-L37","documentation":"The pre-response plugin could not build the HTTP request to its hook — invalid URL or rejected headers/body. As with 1285, the message text mentions 'pre-parse plugin' though it is raised by the pre-response executor; field {1} carries the builder's reason.","triggerScenarios":"Malformed hook URL in pre-response plugin config, or header values containing illegal characters pulled from config or env vars.","commonSituations":"Config typo in the hook URL; template-rendered URLs producing invalid output; newline or non-ASCII characters in a header value sourced from env.","solutions":["Inspect the {1} field for the exact builder rejection reason.","Validate the URL with url::Url::parse at startup/config load.","Sanitize header names/values before they are applied to the request builder."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"url::Url::parse(cfg.pre_response_hook_url.trim())?;","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate hook URL and headers in config at startup.","Trim env-sourced URLs to avoid whitespace/newline corruption.","Unit-test request construction for all configured plugins."],"tags":["http","validation","plugin","rust","pre-response-hook"],"backgroundTag":"invalid-url","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}