{"record":{"id":"dbe4ede7355a369f","repo":"FuelLabs/fuel-core","slug":"error","errorCode":null,"errorMessage":"{error}","messagePattern":"\\{error\\}","errorType":"http","errorClass":"CynicReqwestError::ErrorResponse","httpStatus":null,"severity":"error","filePath":"crates/client/src/reqwest_ext.rs","lineNumber":203,"sourceCode":"    ResponseData: serde::de::DeserializeOwned + Send + 'static,\n    ErrorExtensions: serde::de::DeserializeOwned + Send + 'static,\n{\n    let response = match response {\n        Ok(response) => response,\n        Err(e) => return Err(anyhow::anyhow!(\"{e}\")),\n    };\n\n    let status = response.status();\n    if !status.is_success() {\n        let text = response.text().await;\n        let text = match text {\n            Ok(text) => text,\n            Err(e) => return Err(anyhow::anyhow!(\"{e}\")),\n        };\n\n        let Ok(deserred) = serde_json::from_str(&text) else {\n            let error = CynicReqwestError::ErrorResponse(status, text);\n            return Err(anyhow::anyhow!(\"{error}\"));\n        };\n\n        Ok(deserred)\n    } else {\n        let json = response.json().await;\n        json.map_err(|e| anyhow::anyhow!(\"{e}\"))\n    }\n}\n\nimpl ReqwestExt for reqwest::RequestBuilder {\n    fn run_fuel_graphql<ResponseData, Vars>(\n        self,\n        operation: FuelOperation<Operation<ResponseData, Vars>>,\n    ) -> CynicReqwestBuilder<ResponseData>\n    where\n        Vars: serde::Serialize,\n        ResponseData: serde::de::DeserializeOwned + 'static,\n    {","sourceCodeStart":185,"sourceCodeEnd":221,"githubUrl":"https://github.com/FuelLabs/fuel-core/blob/b9d4d170da3a31c9ace5f963d633b326348e0d42/crates/client/src/reqwest_ext.rs#L185-L221","documentation":"In run_fuel_graphql's response handling (crates/client/src/reqwest_ext.rs:193-210), a non-2xx HTTP status triggers body-text capture; if that body is not valid JSON (i.e. not a GraphQL error payload), it is wrapped as CynicReqwestError::ErrorResponse(status, text) and surfaced as an anyhow error via '{error}'. This message therefore means: the server answered with an HTTP error status whose body was not a GraphQL response — typically an HTML or plain-text error page from a proxy, gateway, or the wrong endpoint.","triggerScenarios":"Posting a Fuel GraphQL operation to a URL that returns 404/502/503/504 with an HTML or text body: missing /v1/graphql path or wrong port, reverse proxy failing while the node restarts, rate-limit page, or an auth gateway returning a login page.","commonSituations":"Wrong endpoint URL (path or port); node down with a load balancer serving an error page; gateway timeouts returning HTML; hitting a protected endpoint behind SSO/auth proxies.","solutions":["Point the client at the node's GraphQL endpoint (e.g. http://127.0.0.1:4000/v1/graphql) and verify with curl -X POST.","If the embedded status is 502/503/504, treat it as transient: retry with backoff or fail over to another URL via FuelClient::with_urls.","Read the body text embedded in the error — it usually identifies the proxy, gateway, or failure reason.","If behind a gateway, ensure it forwards GraphQL POST bodies and does not rewrite or intercept responses."],"exampleFix":"// before\nlet resp = req.post(url).run_fuel_graphql(op).await?; // anyhow('{error}') on HTML 502\n\n// after\nlet resp = match req.post(url).run_fuel_graphql(op).await {\n    Ok(resp) => resp,\n    Err(e) if [\"500\", \"502\", \"503\", \"504\"].iter().any(|s| e.to_string().contains(s)) => {\n        // gateway/proxy-style failure: retry with backoff or switch endpoint\n        retry_with_backoff(|| post_operation(&client, &op)).await?\n    }\n    Err(e) => return Err(e),\n};","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"match req.post(url).run_fuel_graphql(op).await {\n    Ok(resp) => resp,\n    Err(e) if [\"500\", \"502\", \"503\", \"504\"].iter().any(|s| e.to_string().contains(s)) => {\n        // proxy/gateway style failure: retry with backoff or fail over to the next URL\n        retry_with_backoff(|| post_operation(&client, &op)).await?\n    }\n    Err(e) => return Err(e.context(format!(\"Fuel GraphQL request to {url} failed\"))),\n};","preventionTips":["Verify the endpoint with curl -X POST <url> -H 'content-type: application/json' before shipping.","Use FuelClient::with_urls with multiple endpoints so the failover transport absorbs single-node failures.","Monitor for non-JSON error bodies (proxies, rate limiters) and alert on them separately from GraphQL errors.","Read the body text embedded in the error message — it identifies the gateway or wrong-path cause."],"tags":["rust","fuel-client","network","http","graphql","proxy"],"backgroundTag":null,"analyzedSha":"b9d4d170da3a31c9ace5f963d633b326348e0d42","analyzedAt":"2026-08-16T08:56:42.692Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}