{"record":{"id":"3c7a969756c99cac","repo":"nautechsystems/nautilus_trader","slug":"eth-call-redirect-rejected","errorCode":null,"errorMessage":"eth_call redirect rejected","messagePattern":"eth_call redirect rejected","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/blockchain/src/rpc/http.rs","lineNumber":540,"sourceCode":"        });\n\n        if let Some(from) = from {\n            call[\"from\"] = serde_json::json!(from);\n        }\n        let request = serde_json::json!({\n            \"jsonrpc\": \"2.0\",\n            \"id\": 1,\n            \"method\": \"eth_call\",\n            \"params\": [call, block_parameter(Some(block))],\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!(\"eth_call redirect rejected\")\n                }\n                _ => anyhow::anyhow!(\"eth_call request failed\"),\n            })?;\n        let parsed = serde_json::from_slice::<RpcNodeHttpResponse<String>>(bytes.as_ref())\n            .map_err(|_| anyhow::anyhow!(\"Failed to parse eth_call response\"))?;\n\n        if parsed.jsonrpc.is_none()\n            && let (Some(code), Some(message)) = (parsed.code, parsed.message)\n        {\n            if eth_call_error_is_revert(code, &message) {\n                return Ok(RpcCallResult::Reverted);\n            }\n            anyhow::bail!(\"eth_call RPC error {code}\");\n        }\n\n        if let Some(error) = parsed.error {\n            if eth_call_error_is_revert(error.code, &error.message) {\n                return Ok(RpcCallResult::Reverted);","sourceCodeStart":522,"sourceCodeEnd":558,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/blockchain/src/rpc/http.rs#L522-L558","documentation":"In `call_result_at`, when the HTTP client reports `BlockchainRpcClientError::ClientError` containing \"redirect response rejected\" during an `eth_call`, this error is raised with the method name. It indicates the node endpoint attempted an HTTP redirect, which this client refuses for security/reliability.","triggerScenarios":"Calling `call_at` (eth_call) where the configured URL yields a 3xx redirect — wrong path, http->https redirect, or load balancer redirecting to a login/canonical URL.","commonSituations":"Endpoint URL missing the JSON-RPC path, TLS termination redirecting plain HTTP, or CDN redirecting to a regional canonical domain.","solutions":["Update the RPC URL to the final destination (follow the redirect manually once and hardcode it)","Use https:// if the node redirects http->https","Check proxy/load balancer redirect rules on the eth_call route","Confirm the URL path points at the JSON-RPC handler"],"exampleFix":"// before\nlet url = \"http://node.internal:8545\"; // redirects to /rpc\n// after\nlet url = \"http://node.internal:8545/rpc\";","handlingStrategy":"validation","validationCode":"// assert no redirect on the eth_call route before integration:\n// curl -sI -X POST $URL -d '{\"jsonrpc\":\"2.0\",\"method\":\"eth_call\",\"params\":[{},\"latest\"],\"id\":1}'\n// expect HTTP 200","typeGuard":null,"tryCatchPattern":"match client.call_at(&tx, Some(block)).await {\n    Err(e) if e.to_string().contains(\"redirect rejected\") => {\n        // resolve final URL (scheme/path) and reconfigure before retrying\n    }\n    other => other,\n}","preventionTips":["Hardcode the final endpoint URL rather than one that redirects","Use https endpoints to avoid http->https redirects","Verify endpoints return 200 (not 3xx) during setup","Check load balancer canonical-URL redirects"],"tags":["rpc","redirect","http","eth-call"],"backgroundTag":"invalid-url","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"}