hasura/graphql-engine · error · Error

Error while making the HTTP request to the pre-parse plugin

Error message

Error while making the HTTP request to the pre-parse plugin {0} - {1}

What it means

The pre-route plugin executor failed to make the HTTP request to its hook at the transport level (connect refused, DNS, timeout). The message text says 'pre-parse plugin' but the variant is defined in the pre-route plugin's executor — the wording is shared across plugin crates. Fields: hook URL and reqwest::Error.

Source

Thrown at v3/crates/plugins/pre-route-plugin/src/execute.rs:22

    http::{HeaderMap, HeaderName, StatusCode},
    response::IntoResponse,
};
use http_body_util::BodyExt;
use regex::Regex;
use serde::Serialize;

use open_dds::plugins::{
    LifecyclePreRoutePluginHook, LifecyclePreRoutePluginHookConfigRequestMethod,
    LifecyclePreRoutePluginHookIncomingHTTPMethod,
};
use serde_json::json;
use tracing_util::{
    ErrorVisibility, SpanVisibility, Traceable, TraceableError, set_attribute_on_active_span,
};

#[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),
    #[error("HTTP method {0} not supported")]
    UnsupportedHTTPMethod(String),
    #[error("Invalid header name {0}")]
    InvalidHeaderName(String),
    #[error("Invalid header value {0}")]
    InvalidHeaderValue(String),
    #[error("Not found")]
    NotFound,
    // Only used in the pre-route plugin handler function. Defined to ensure consistent

View on GitHub (pinned to 724551b9ae)

Solutions

  1. Verify the pre-route hook endpoint is reachable from the engine (curl from the same network namespace).
  2. Correct the hook URL in plugin config.
  3. Add readiness-gating so the plugin is healthy before the engine serves traffic.
  4. Adjust timeouts/retries for the hook call.
Defensive patterns

Strategy: retry

Validate before calling

// startup gate: only enable routing once the hook answers
if reqwest::get(&cfg.pre_route_hook_url).await.is_err() { delay_enable(); }

Try / catch

Err(Error::ErrorWhileMakingHTTPRequestToTheHook(_, ref re)) if re.is_connect() => {
    tracing::warn!("pre-route hook down; routing without plugin or retrying");
    route_without_plugin().await
}

Prevention

When it happens

Trigger: A pre-route plugin is configured; before routing, the engine calls the hook and the TCP/HTTP request itself fails (service unreachable or timing out).

Common situations: Pre-route hook not deployed or scaled to zero; wrong service DNS name; startup ordering where the engine is ready before the plugin; network policy blocks the route.

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/98e296b7cf4d810a. Report an issue: GitHub.