nautechsystems/nautilus_trader · error

debug_traceTransaction returned no result

Error message

debug_traceTransaction returned no result

What it means

`trace_transaction_call` issues `debug_traceTransaction` with a `callTracer` config and returns the raw JSON result; when the node responds with `result: null` (or omits it), this error is raised. A null result means the node could not produce a trace — usually the transaction hash is unknown, already pruned, or `debug_*` tracing is disabled.

Source

Thrown at crates/adapters/blockchain/src/rpc/http.rs:797

        &self,
        tx_hash: &B256,
    ) -> anyhow::Result<RpcCallTrace> {
        let result: Option<RpcCallTrace> = self
            .execute_execution_rpc_call(
                "debug_traceTransaction",
                serde_json::json!([
                    tx_hash,
                    {
                        "tracer": "callTracer",
                        "tracerConfig": {
                            "onlyTopCall": false,
                            "withLog": false,
                        },
                    }
                ]),
            )
            .await?;
        result.ok_or_else(|| anyhow::anyhow!("debug_traceTransaction returned no result"))
    }

    /// Probes whether the endpoint recognizes the configured `callTracer` request shape.
    #[cfg(feature = "hypersync")]
    pub(crate) async fn probe_call_trace(&self) -> anyhow::Result<()> {
        let request = serde_json::json!({
            "jsonrpc": "2.0",
            "id": 1,
            "method": "debug_traceTransaction",
            "params": [
                B256::ZERO,
                {
                    "tracer": "callTracer",
                    "tracerConfig": {
                        "onlyTopCall": false,
                        "withLog": false,
                    },
                }

View on GitHub (pinned to 18893faf8b)

Solutions

  1. Verify the tx hash exists on the connected chain (`eth_getTransactionReceipt` returns non-null)
  2. Retry after a short delay if the tx is very recent (indexing lag)
  3. Use an archive/trace-enabled node; ensure `debug` API namespace is enabled in node config
  4. Re-check the hash for typos or cross-chain mixups

Example fix

// before: tracing on a pruned node -> null result
let trace = client.trace_transaction(tx_hash).await?; // Err: returned no result
// after: confirm availability first, then trace on archive node
let receipt = client.raw.eth_get_transaction_receipt(tx_hash).await?;
let trace = if receipt.is_some() { archive_client.trace_transaction(tx_hash).await? } else { bail!("tx unknown on this node") };
Defensive patterns

Strategy: validation

Validate before calling

async fn tx_known_and_traceable(url: &str, tx_hash: &str) -> bool {
    let receipt = send_raw(url, json!({"jsonrpc":"2.0","method":"eth_getTransactionReceipt","params":[tx_hash],"id":1})).await;
    let known = receipt.map(|v| !v["result"].is_null()).unwrap_or(false);
    let debug_open = send_raw(url, json!({"jsonrpc":"2.0","method":"debug_traceTransaction","params":[known_tx_hash_for_probe, {"tracer":"callTracer"}],"id":1})).await.is_ok();
    known && debug_open
}

Try / catch

match client.trace_transaction(tx_hash).await {
    Ok(t) => Ok(t),
    Err(e) if e.to_string().contains("returned no result") => {
        Err(anyhow!("trace unavailable for {tx_hash}: pruned, unindexed, or debug API disabled"))
    }
    Err(e) => Err(e),
}

Prevention

When it happens

Trigger: Calling `debug_traceTransaction` for a transaction hash the node does not know (not yet indexed, wrong chain, or reorged), or a non-archive/pruned node that discarded the trace state; some nodes also return null when tracing is disabled.

Common situations: Tracing a very recent tx before the node indexed it; tracing old txs on a pruned non-archive node; sending the hash to a node on a different network; managed providers that disable `debug_*` namespace.

Understand the failure class

Background: EmptyResultError / "no results found": when an API or scraper succeeds but returns zero rows — this error's family across 9 libraries.

Related errors


AI-assisted analysis of nautechsystems/nautilus_trader@18893faf8b (2026-09-08). Data as JSON: /api/errors/d9020e2ba461a372. Report an issue: GitHub.