hasura/graphql-engine · error · Error

Reqwest error: {0}

Error message

Reqwest error: {0}

What it means

A generic wrapper around a reqwest::Error produced by the pre-parse plugin executor when the error does not fit the more specific variants (e.g. response body read failures or redirects). The underlying reqwest error is included verbatim.

Source

Thrown at v3/crates/plugins/pre-parse-plugin/src/execute.rs:29

use lang_graphql::{ast::common as ast, http::RawRequest};
use open_dds::plugins::LifecyclePreParsePluginHook;
use tracing_util::{
    ErrorVisibility, SpanVisibility, Traceable, TraceableError, set_attribute_on_active_span,
};

/// HTTP status code used by pre-parse plugins to indicate they want to continue
/// processing with a modified request body.
///
/// We use 299 (an unassigned 2xx status code) as a special signal for this.
const CONTINUE_WITH_REQUEST_STATUS: u16 = 299;

#[derive(Debug, thiserror::Error)]
pub enum Error {
    #[error("Error while making the HTTP request to the pre-parse plugin {0} - {1}")]
    ErrorWhileMakingHTTPRequestToTheHook(String, reqwest::Error),
    #[error("Error while building the request for the pre-parse plugin {0} - {1}")]
    BuildRequestError(String, String),
    #[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),
}

impl Error {
    pub fn is_internal(&self) -> bool {
        match self {
            Error::ErrorWhileMakingHTTPRequestToTheHook(_, _) | Error::UnexpectedStatusCode(_) => {
                false
            }
            Error::BuildRequestError(_, _)
            | Error::ReqwestError(_)
            | Error::PluginRequestParseError(_) => true,
        }
    }

View on GitHub (pinned to 724551b9ae)

Solutions

  1. Inspect the wrapped reqwest error text for the root cause category (timeout, body read, TLS).
  2. Check plugin service logs for crashes or aborted responses around the same time.
  3. Stabilize the network path between engine and plugin (proxy, keep-alive, timeouts).
  4. Retry transient failures via the engine's retry policy if configured.
Defensive patterns

Strategy: retry

Try / catch

match res {
    Err(Error::ReqwestError(e)) if e.is_timeout() || e.is_connect() => retry().await,
    other => other,
}

Prevention

When it happens

Trigger: Any reqwest operation in the pre-parse hook execution path failing outside of explicit request-build or send scenarios, such as reading a chunked response body that dies mid-stream.

Common situations: Plugin closes the connection mid-response; proxy interrupts the stream; TLS handshake issues surfacing at an unexpected stage.

Understand the failure class

Background: 'Something went wrong' / 'Request failed (500)' / 'HTTP error! status: 404' — what failed HTTP requests actually mean and how to find the real cause — this error's family across 28 libraries.

Related errors


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