hasura/graphql-engine · error · Error

Reqwest error: {0}

Error message

Reqwest error: {0}

What it means

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.

Source

Thrown at v3/crates/plugins/pre-ndc-response-plugin/src/execute.rs:20

use engine_types::HttpContext;
use hasura_authn_core::{Role, Session, SessionVariableName};
use metadata_resolve::{DataConnectorLink, Qualified, ResolvedLifecyclePreNdcResponsePluginHook};
use open_dds::data_connector::DataConnectorName;
use reqwest::{
    Client,
    header::{InvalidHeaderName, InvalidHeaderValue},
};
use serde::{Deserialize, Serialize};
use std::{collections::BTreeMap, str::FromStr, sync::Arc};
use tracing_util::{ErrorVisibility, SpanVisibility, TraceableError, set_attribute_on_active_span};

#[derive(Debug, thiserror::Error)]
pub enum Error {
    #[error("Error while making the HTTP request to the pre-response plugin {0} - {1}")]
    ErrorWhileMakingHTTPRequestToTheHook(String, reqwest::Error),
    #[error("Error while building the request for the pre-response plugin {0} - {1}")]
    BuildRequestError(String, #[source] BuildRequestError),
    #[error("Reqwest error: {0}")]
    ReqwestError(reqwest::Error),
    #[error("Unexpected status code: {0}")]
    UnexpectedStatusCode(u16),
    #[error("Error parsing the request: {0}")]
    PluginRequestParseError(serde_json::error::Error),
    #[error("Internal error from plugin {plugin_name}")]
    PluginInternalError {
        plugin_name: String,
        error: serde_json::Value,
    },
    #[error("User error from plugin {plugin_name}")]
    PluginUserError {
        plugin_name: String,
        error: serde_json::Value,
    },
}

#[derive(Debug, thiserror::Error)]

View on GitHub (pinned to 724551b9ae)

Solutions

  1. Retry the request — transient body-read failures often resolve themselves
  2. Check plugin logs for crashes or OOM kills during response generation
  3. Inspect proxy/LB idle timeouts between engine and plugin
  4. Keep plugin responses small and fast to avoid mid-body disconnects
Defensive patterns

Strategy: retry

Try / catch

match resp.json::<HookResponse>().await {
    Err(e) if e.is_decode() || e.is_body() => retry_with_backoff(),
    other => other,
}

Prevention

When it happens

Trigger: 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.

Common situations: Plugin crashing mid-response; proxies/load balancers cutting long-lived responses; response bodies larger than buffer limits; flaky networking between engine and plugin sidecars.

Related errors


AI-assisted analysis of hasura/graphql-engine@724551b9ae (2026-08-28). Data as JSON: /api/errors/3e0b695816c66b34. Report an issue: GitHub.