{"record":{"id":"4433a0dd6c239794","repo":"hasura/graphql-engine","slug":"error-while-making-the-http-request-to-the-pre-par-4433a0","errorCode":null,"errorMessage":"Error while making the HTTP request to the pre-parse plugin {0} - {1}","messagePattern":"Error while making the HTTP request to the pre-parse plugin (.+?) - (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"v3/crates/plugins/pre-parse-plugin/src/execute.rs","lineNumber":25,"sourceCode":"use reqwest::header::HeaderValue;\nuse serde::Serialize;\n\nuse hasura_authn_core::Session;\nuse lang_graphql::{ast::common as ast, http::RawRequest};\nuse open_dds::plugins::LifecyclePreParsePluginHook;\nuse tracing_util::{\n    ErrorVisibility, SpanVisibility, Traceable, TraceableError, set_attribute_on_active_span,\n};\n\n/// HTTP status code used by pre-parse plugins to indicate they want to continue\n/// processing with a modified request body.\n///\n/// We use 299 (an unassigned 2xx status code) as a special signal for this.\nconst CONTINUE_WITH_REQUEST_STATUS: u16 = 299;\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(\"Unexpected status code: {0}\")]\n    UnexpectedStatusCode(u16),\n    #[error(\"Error parsing the request: {0}\")]\n    PluginRequestParseError(serde_json::error::Error),\n}\n\nimpl Error {\n    pub fn is_internal(&self) -> bool {\n        match self {\n            Error::ErrorWhileMakingHTTPRequestToTheHook(_, _) | Error::UnexpectedStatusCode(_) => {\n                false\n            }\n            Error::BuildRequestError(_, _)","sourceCodeStart":7,"sourceCodeEnd":43,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/v3/crates/plugins/pre-parse-plugin/src/execute.rs#L7-L43","documentation":"This error is thrown by the pre-parse plugin executor when the HTTP request it issues to an external pre-parse hook endpoint fails at the transport level (DNS failure, connection refused, timeout, TLS error). The message includes the plugin/hook URL ({0}) and the underlying reqwest::Error ({1}). It means the engine never got an HTTP response from the hook at all, as opposed to a bad status code or parse failure.","triggerScenarios":"Calling an operation with a pre-parse plugin configured whose URL is unreachable, e.g. wrong port, service not started, DNS name typo, or the hook timing out before responding.","commonSituations":"Local dev where the plugin service is not running; misconfigured plugin URL in router/plugin config; network policies or mTLS issues between engine and plugin; plugin crash-looping so the connection is refused.","solutions":["Verify the pre-parse plugin service is running and healthy at the configured URL (curl it from the engine host).","Fix the plugin URL/port in the plugin configuration used by the engine.","Check network connectivity, DNS resolution, and firewall/proxy rules between the engine and the plugin.","Increase request timeout settings if the hook is slow to respond."],"exampleFix":"// before\npre_parse_plugin:\n  url: http://plugin-svc:9090/hook\n\n// after (correct host/port once the service is up)\npre_parse_plugin:\n  url: http://plugin-svc:9443/hook","handlingStrategy":"retry","validationCode":"// before configuring, ensure the hook is reachable\nasync fn hook_alive(url: &str) -> bool {\n    reqwest::get(url).await.map(|r| r.status().is_success()).unwrap_or(false)\n}","typeGuard":null,"tryCatchPattern":"// treat as transient; retry with backoff, then fall back to no-plugin behavior\nmatch execute_pre_parse(&req).await {\n    Ok(v) => v,\n    Err(e) if matches!(e, pre_parse_plugin::execute::Error::ErrorWhileMakingHTTPRequestToTheHook(_, _)) => {\n        tracing::warn!(\"pre-parse hook unreachable, skipping: {e}\");\n        req // or retry with backoff\n    }\n    Err(e) => return Err(e.into()),\n}","preventionTips":["Run a readiness probe on the hook service before enabling the plugin.","Configure explicit timeouts and retries for hook calls.","Alert on hook connection-refused metrics from the engine."],"tags":["network","http","plugin","rust","pre-parse-hook"],"backgroundTag":"http-request-failed","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}