{"record":{"id":"3e0b695816c66b34","repo":"hasura/graphql-engine","slug":"reqwest-error-0-3e0b69","errorCode":null,"errorMessage":"Reqwest error: {0}","messagePattern":"Reqwest error: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"v3/crates/plugins/pre-ndc-response-plugin/src/execute.rs","lineNumber":20,"sourceCode":"use 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}\n\n#[derive(Debug, thiserror::Error)]","sourceCodeStart":2,"sourceCodeEnd":38,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/v3/crates/plugins/pre-ndc-response-plugin/src/execute.rs#L2-L38","documentation":"A reqwest-level failure during communication with the pre-NDC-response plugin that is not covered by the more specific ErrorWhileMakingHTTPRequestToTheHook variant — typically failures while reading or decoding the response body (chunk read error, connection reset mid-body, body decode). The {0} is the underlying reqwest::Error.","triggerScenarios":"The POST to the plugin hook succeeds at the status-code level but resp.json()/bytes() fails because the connection drops or the body is truncated.","commonSituations":"Plugin crashing mid-response; proxies/load balancers cutting long-lived responses; response bodies larger than buffer limits; flaky networking between engine and plugin sidecars.","solutions":["Retry the request — transient body-read failures often resolve themselves","Check plugin logs for crashes or OOM kills during response generation","Inspect proxy/LB idle timeouts between engine and plugin","Keep plugin responses small and fast to avoid mid-body disconnects"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"match resp.json::<HookResponse>().await {\n    Err(e) if e.is_decode() || e.is_body() => retry_with_backoff(),\n    other => other,\n}","preventionTips":["Set sane client timeouts","Keep plugin responses compact","Monitor plugin process health"],"tags":["rust","network","http","plugin","reqwest"],"backgroundTag":"http-body-read-failed","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}