{"record":{"id":"3c12b6915841a299","repo":"nautechsystems/nautilus_trader","slug":"debug-tracetransaction-rpc-error-code","errorCode":null,"errorMessage":"debug_traceTransaction RPC error {code}","messagePattern":"debug_traceTransaction RPC error (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/blockchain/src/rpc/http.rs","lineNumber":993,"sourceCode":"        })\n}\n\nfn block_parameter(block: Option<u64>) -> serde_json::Value {\n    block.map_or_else(\n        || serde_json::json!(\"latest\"),\n        |number| serde_json::json!(format!(\"0x{number:x}\")),\n    )\n}\n\n#[cfg(feature = \"hypersync\")]\nfn eth_call_error_is_revert(code: i32, message: &str) -> bool {\n    code == 3 || message.to_ascii_lowercase().contains(\"revert\")\n}\n\n#[cfg(feature = \"hypersync\")]\nfn trace_probe_result(code: i32) -> anyhow::Result<()> {\n    if matches!(code, -32_601 | -32_602) {\n        anyhow::bail!(\"debug_traceTransaction RPC error {code}\");\n    }\n    Ok(())\n}\n\nfn rpc_response_preview(raw_response: &str) -> String {\n    if raw_response.len() <= 500 {\n        return raw_response.to_string();\n    }\n\n    let mut end = 500;\n    while !raw_response.is_char_boundary(end) {\n        end -= 1;\n    }\n    format!(\n        \"{}... (truncated, {} bytes total)\",\n        &raw_response[..end],\n        raw_response.len()\n    )","sourceCodeStart":975,"sourceCodeEnd":1011,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/blockchain/src/rpc/http.rs#L975-L1011","documentation":"Raised by `trace_probe_result` (used by `probe_call_trace` via `debug_traceTransaction` with `callTracer`) when the node returns JSON-RPC error code -32601 (method not found) or -32602 (invalid params) for the trace request. It indicates the endpoint cannot serve `debug_traceTransaction` at all, rather than a per-transaction failure.","triggerScenarios":"Calling `probe_call_trace`/`trace_probe_result` against a node that doesn't implement `debug_traceTransaction` (-32601) or rejects its tracer params (-32602).","commonSituations":"Using a public/load-balanced RPC that disables debug APIs; pointing at Erigon/Nethermind configurations with different tracer support; missing `--http.api debug,eth` flag on a self-hosted Geth.","solutions":["Use an RPC endpoint that supports debug/trace APIs (archive provider or self-hosted node with `debug` module enabled).","On self-hosted Geth, enable it: `--http.api eth,net,web3,debug` and `--syncmode full` (or archive).","If -32602, check the tracer name/options (`callTracer` config) match the client version.","Fall back to an alternative tracing method (e.g. trace_block/ots APIs) if the provider can't enable debug."],"exampleFix":"// geth flags: before\ngeth --http --http.api eth,net,web3\n// after\ngeth --http --http.api eth,net,web3,debug --gcmode archive --syncmode full","handlingStrategy":"fallback","validationCode":"// Probe debug API availability before tracing\nlet ok: Result<String, _> = provider.request(\"debug_traceTransaction\", (B256::ZERO, serde_json::json!({\"tracer\": \"callTracer\"}))).await;\nlet tracing_available = ok.is_ok() || !matches!(err_code(&ok), Some(-32601 | -32602));","typeGuard":"fn is_unsupported_method(err: &anyhow::Error) -> bool {\n    err.to_string().contains(\"RPC error -32601\") || err.to_string().contains(\"RPC error -32602\")\n}","tryCatchPattern":"match probe_call_trace(...).await {\n    Err(e) if is_unsupported_method(&e) => fallback_to_event_log_reconstruction(tx),\n    other => other,\n}","preventionTips":["Confirm the provider exposes debug/trace APIs before designing on them","On self-hosted Geth enable `--http.api ...debug` and archive mode","Keep a fallback strategy that reconstructs calls from logs/receipts","Check tracer option compatibility with the specific client version"],"tags":["evm","rpc","tracing","unsupported-method"],"backgroundTag":"operation-not-supported","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}