{"record":{"id":"bf6787acbf86d51f","repo":"nautechsystems/nautilus_trader","slug":"method-request-failed","errorCode":null,"errorMessage":"{method} request failed","messagePattern":"(.+?) request failed","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/blockchain/src/rpc/http.rs","lineNumber":333,"sourceCode":"        params: serde_json::Value,\n    ) -> anyhow::Result<Option<T>> {\n        let request = serde_json::json!({\n            \"jsonrpc\": \"2.0\",\n            \"id\": 1,\n            \"method\": method,\n            \"params\": params,\n        });\n\n        let bytes = self\n            .send_rpc_request(request, Some(EXECUTION_RPC_TIMEOUT_SECS))\n            .await\n            .map_err(|e| match e {\n                BlockchainRpcClientError::ClientError(message)\n                    if message.contains(\"redirect response rejected\") =>\n                {\n                    anyhow::anyhow!(\"{method} redirect rejected\")\n                }\n                _ => anyhow::anyhow!(\"{method} request failed\"),\n            })?;\n\n        let parsed = serde_json::from_slice::<RpcNodeHttpResponse<T>>(bytes.as_ref())\n            .map_err(|_| anyhow::anyhow!(\"Failed to parse {method} response\"))?;\n\n        if parsed.jsonrpc.is_none()\n            && let (Some(code), Some(_message)) = (parsed.code, parsed.message)\n        {\n            anyhow::bail!(\"{method} RPC error {code}\");\n        }\n\n        if let Some(error) = parsed.error {\n            anyhow::bail!(\"{method} RPC error {}\", error.code);\n        }\n\n        Ok(parsed.result)\n    }\n","sourceCodeStart":315,"sourceCodeEnd":351,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/blockchain/src/rpc/http.rs#L315-L351","documentation":"Generic failure wrapper for execution-layer JSON-RPC requests: when `send_rpc_request` returns any error other than a rejected redirect, this error is raised with the failing method name. It masks the underlying transport/timeout/HTTP cause behind a uniform message.","triggerScenarios":"Any of the callers (chain_id, get_storage_at, get_code_with_block, get_transaction_count_pending/latest/at) failing due to connection errors, timeouts (EXECUTION_RPC_TIMEOUT_SECS exceeded), DNS failures, TLS errors, or non-redirect HTTP errors from the node.","commonSituations":"Node is down or unreachable, firewall blocking the RPC port, RPC request timing out under load, or an authenticated endpoint returning 401/403.","solutions":["Check node reachability (curl a simple eth_chainId against the endpoint)","Increase EXECUTION_RPC_TIMEOUT_SECS or reduce request load if timing out","Inspect logs of the underlying client error to identify transport cause","Verify network/firewall/TLS configuration between client and node"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// pre-flight reachability check before RPC usage\n// curl -sf -X POST $URL -H 'Content-Type: application/json' \\\n//   -d '{\"jsonrpc\":\"2.0\",\"method\":\"eth_chainId\",\"params\":[],\"id\":1}'","typeGuard":null,"tryCatchPattern":"match client.chain_id().await {\n    Err(e) if e.to_string().contains(\"request failed\") => {\n        // retry with backoff; check node health before giving up\n    }\n    other => other,\n}","preventionTips":["Add retry with exponential backoff for transient transport errors","Monitor node availability and alert on failures","Set realistic timeouts (EXECUTION_RPC_TIMEOUT_SECS) for your network","Keep fallback node URLs configured"],"tags":["rpc","http","network","request-failed"],"backgroundTag":"api-request-failed","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}