hasura/graphql-engine · error · Error

Error while making the HTTP request to the pre-response plug

Error message

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

What it means

The engine could not complete the outbound HTTP call to the configured pre-NDC-response (post-response) hook plugin: connection refused, DNS failure, timeout, or TLS error. The two placeholders carry the plugin name and the underlying reqwest::Error. It fires before any status code is received — the plugin endpoint was unreachable at the URL from config.

Source

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

use axum::http::HeaderName;
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,

View on GitHub (pinned to 724551b9ae)

Solutions

  1. Check the plugin service is running and healthy (curl the plugin URL from the engine pod)
  2. Verify the webhook URL, port, and scheme in the plugin config
  3. Test DNS resolution and network connectivity from the engine's environment
  4. If TLS is used, confirm the certificate is trusted and matches the hostname
Defensive patterns

Strategy: retry

Validate before calling

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

Try / catch

match client.post(&url).json(&body).send().await {
    Err(e) if e.is_connect() || e.is_timeout() => retry_with_backoff(),
    other => other,
}

Prevention

When it happens

Trigger: Executing a request whose response triggers the pre-response hook; reqwest's .send() returns Err (plugin service down, wrong URL/port, DNS not resolvable, TLS handshake failure, timeout).

Common situations: Plugin not deployed or crashed; wrong URL in the connector's plugin webhook config; network policy blocking engine→plugin traffic in Kubernetes; TLS cert mismatch when using https webhooks.

Related errors


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