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

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.

Source

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

use reqwest::header::HeaderValue;
use serde::Serialize;

use hasura_authn_core::Session;
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(_, _)

View on GitHub (pinned to 724551b9ae)

Solutions

  1. Verify the pre-parse plugin service is running and healthy at the configured URL (curl it from the engine host).
  2. Fix the plugin URL/port in the plugin configuration used by the engine.
  3. Check network connectivity, DNS resolution, and firewall/proxy rules between the engine and the plugin.
  4. Increase request timeout settings if the hook is slow to respond.

Example fix

// before
pre_parse_plugin:
  url: http://plugin-svc:9090/hook

// after (correct host/port once the service is up)
pre_parse_plugin:
  url: http://plugin-svc:9443/hook
Defensive patterns

Strategy: retry

Validate before calling

// before configuring, ensure the hook is reachable
async fn hook_alive(url: &str) -> bool {
    reqwest::get(url).await.map(|r| r.status().is_success()).unwrap_or(false)
}

Try / catch

// treat as transient; retry with backoff, then fall back to no-plugin behavior
match execute_pre_parse(&req).await {
    Ok(v) => v,
    Err(e) if matches!(e, pre_parse_plugin::execute::Error::ErrorWhileMakingHTTPRequestToTheHook(_, _)) => {
        tracing::warn!("pre-parse hook unreachable, skipping: {e}");
        req // or retry with backoff
    }
    Err(e) => return Err(e.into()),
}

Prevention

When it happens

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

Common situations: 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.

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/4433a0dd6c239794. Report an issue: GitHub.