{"record":{"id":"7b998303700323f6","repo":"influxdata/influxdb","slug":"failed-to-send-method-url-request","errorCode":null,"errorMessage":"failed to send {method} {url} request: {}","messagePattern":"failed to send (.+?) (.+?) request: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"influxdb3_client/src/lib.rs","lineNumber":64,"sourceCode":"\n    #[error(\"invalid UTF8 in response: {0}\")]\n    InvalidUtf8(#[from] FromUtf8Error),\n\n    #[error(\"failed to parse JSON response: {}\", reqwest_description(.0))]\n    Json(#[source] reqwest::Error),\n\n    #[error(\"failed to parse plaintext response: {}\", reqwest_description(.0))]\n    Text(#[source] reqwest::Error),\n\n    #[error(\"server responded with error [{code}]: {message}\")]\n    ApiError {\n        code: StatusCode,\n        message: String,\n        /// Machine-readable error code from JSON error responses, if present.\n        error_code: Option<String>,\n    },\n\n    #[error(\"failed to send {method} {url} request: {}\", reqwest_description(.source))]\n    RequestSend {\n        method: Method,\n        url: String,\n        #[source]\n        source: reqwest::Error,\n    },\n\n    #[error(\"failed to build an http client: {}\", reqwest_description(.0))]\n    Builder(#[source] reqwest::Error),\n\n    #[error(\"io error: {0}\")]\n    IO(#[from] std::io::Error),\n}\n\n/// Try to parse a JSON error response body with `error_code` and `message` fields.\n/// Returns `(message, error_code)`. If JSON parsing fails, treats the body as plain text.\npub(crate) fn parse_error_body(body: &str) -> (String, Option<String>) {\n    #[derive(serde::Deserialize)]","sourceCodeStart":46,"sourceCodeEnd":82,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/influxdb3_client/src/lib.rs#L46-L82","documentation":"Error::RequestSend, raised when the client fails to dispatch an HTTP request at all — reqwest's send() returned an error before any response existed. The message embeds the HTTP method, URL, and reqwest_description of the source error, so it names exactly which request could not be sent and why (DNS, connect, TLS, timeout, redirect loop, etc.).","triggerScenarios":"Calling any Client request method when the target host is unreachable: DNS resolution failure, connection refused, TLS handshake/certificate failure, request timeout, too many redirects, or a request body error (e.g. bad content length).","commonSituations":"Wrong hostname/port in the base URL (connection refused); server not started yet; self-signed or expired certificates; private-cluster DNS not resolvable from the client environment; firewalls blocking egress.","solutions":["Read the source chain (eprintln!(\"{e:#}\")) to see the exact reqwest cause (DNS vs connect vs TLS vs timeout)","Verify the base URL host/port and that the InfluxDB 3 server is running and reachable (curl the /health endpoint)","Fix DNS/network/firewall issues so the host resolves and the port is open","For TLS errors, install/trust the correct CA or configure the client's certificate settings","Add retry with exponential backoff for transient timeouts and connection resets"],"exampleFix":"// before\nlet client = Client::new(\"http://localhost:9999\", ...); // wrong port\nlet resp = client.api_v3_query_sql(...).await?; // RequestSend: connection refused\n// after\nlet client = Client::new(\"http://localhost:8181\", ...);\nlet resp = client.api_v3_query_sql(...).await?;","handlingStrategy":"retry","validationCode":"// pre-flight connectivity check before issuing real requests\nasync fn reachable(base: &str) -> bool {\n    reqwest::get(format!(\"{base}/health\")).await.map(|r| r.status().is_success()).unwrap_or(false)\n}","typeGuard":"fn is_request_send_error(e: &influxdb3_client::Error) -> bool {\n    matches!(e, influxdb3_client::Error::RequestSend { .. })\n}","tryCatchPattern":"match result {\n    Err(influxdb3_client::Error::RequestSend { method, url, source }) => {\n        log::warn!(\"send {method} {url} failed: {source:#}\");\n        if is_transient(&source) { backoff_and_retry().await } else { bail!(...) }\n    }\n    other => other?,\n}","preventionTips":["Verify host/port/DNS from the deployment environment before rollout","Run a curl/health check in readiness probes before the app issues real requests","Configure sane connect/total timeouts in the client builder","Trust the correct CA bundle for TLS endpoints","Wrap calls in bounded retries with exponential backoff for transient failures"],"tags":["network","http","influxdb3","client"],"backgroundTag":"http-request-failed","analyzedSha":"06200ef96ba82c5f6727e5038a83af8e722c6875","analyzedAt":"2026-09-19T12:55:30.003Z","contentChangedAt":"2026-09-19T12:55:30.003Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}