nautechsystems/nautilus_trader · error
RPC block feed selected without an RPC client
Error message
RPC block feed selected without an RPC client
What it means
subscribe_block_feed resolved the configured backend to BlockFeedBackend::Rpc, but the core client has no RPC client configured (rpc_client is None). The RPC block feed cannot run without an HTTP/WS RPC connection, so the call fails fast.
Source
Thrown at crates/adapters/blockchain/src/data/client.rs:1058
core_client: &mut BlockchainDataClientCore,
owner: BlockFeedOwner,
) -> anyhow::Result<()> {
let preferred_backend = if core_client.rpc_client.is_some() {
BlockFeedBackend::Rpc
} else {
BlockFeedBackend::HyperSync
};
let Some(backend) = core_client
.subscription_manager
.add_block_demand(owner, preferred_backend)
else {
return Ok(());
};
let started_backend = match backend {
BlockFeedBackend::Rpc => {
let Some(rpc) = core_client.rpc_client.as_mut() else {
anyhow::bail!("RPC block feed selected without an RPC client")
};
match rpc.subscribe_blocks().await {
Ok(()) => {
log::debug!("Successfully subscribed to blocks via RPC");
BlockFeedBackend::Rpc
}
Err(e) if owner == BlockFeedOwner::Explicit => {
log::warn!(
"RPC blocks subscription failed: {e}, falling back to HyperSync"
);
core_client.hypersync_client.subscribe_blocks();
tokio::task::yield_now().await;
BlockFeedBackend::HyperSync
}
Err(e) => return Err(e.into()),
}
}View on GitHub (pinned to 18893faf8b)
Solutions
- Provide an RPC (WS) URL in the blockchain adapter config so rpc_client is initialized
- Or select the HyperSync block feed backend instead
- Check that rpc_client construction did not silently fail during client build
Example fix
// before # config: block_feed_backend = "rpc" (no rpc_url set) // after [rpc] url = "wss://base-mainnet.g.alchemy.com/v2/<key>" block_feed_backend = "rpc"
Defensive patterns
Strategy: validation
Validate before calling
if backend == BlockFeedBackend::Rpc && client.rpc_client().is_none() {
return Err(anyhow::anyhow!("configure an RPC URL before selecting the rpc block feed"));
} Try / catch
match client.subscribe_block_feed().await {
Err(e) if e.to_string().contains("without an RPC client") => {
log::error!("RPC URL not configured; enable rpc or use hypersync backend");
}
r => r?,
} Prevention
- Validate backend + rpc_url pairing at startup config parsing
- Prefer defaulting to HyperSync when no RPC URL is set
- Add a health check that rpc_client is Some before subscribing
When it happens
Trigger: Calling subscribe_block_feed (or triggering block feed subscription via handle_subscribe_command) when block-feed backend is configured to Rpc but rpc_client was never constructed — e.g. missing RPC URL in config, or the client was built in HyperSync-only mode.
Common situations: Config omits the RPC endpoint/WS URL; environment variable for RPC URL unset; user intended HyperSync backend but selected Rpc; RPC client failed to initialize earlier and was left as None.
Understand the failure class
Background: "is required", "must be set", "missing required field": configuration validation errors across open-source libraries — this error's family across 36 libraries.
Related errors
- Unsupported blockchain {blockchain} for RPC connection
- RPC block feed active without an RPC client
- No RPC URL provided for {}. Set --rpc-url, INFURA_API_KEY, o
- No RPC URL provided for {name}. Set --rpc-url, INFURA_API_KE
- Finalized block {} does not contain transaction {}
AI-assisted analysis of nautechsystems/nautilus_trader@18893faf8b (2026-09-08).
Data as JSON: /api/errors/26ff1dc82cd24d50.
Report an issue: GitHub.