TriportRPC

Block not available for slot (-32004)

Last updated:

At a glance

Error details
PropertyValue
Code-32004
MessageBlock not available for slot
Categoryblock

Cause

The requested slot's block is not available on this node — it may not have been produced, may be ahead of the node's current slot, or has aged out of the node's ledger retention.

Solution

  1. Check the slot exists with `getBlocks` / `getBlockTime` before fetching.
  2. Query a node with longer ledger retention for historical slots.
  3. For recent slots, retry after the node catches up (compare with `getSlot`).

Example

{
  "id": 1,
  "error": {
    "code": -32004,
    "message": "Block not available for slot 123456789"
  },
  "jsonrpc": "2.0"
}

FAQ

Why does "Block not available for slot" happen?
The requested slot's block is not available on this node — it may not have been produced, may be ahead of the node's current slot, or has aged out of the node's ledger retention.
How do I fix "Block not available for slot"?
Check the slot exists with `getBlocks` / `getBlockTime` before fetching. Query a node with longer ledger retention for historical slots. For recent slots, retry after the node catches up (compare with `getSlot`).
What is RPC error -32004?
-32004 means: Block not available for slot. The requested slot's block is not available on this node — it may not have been produced, may be ahead of the node's current slot, or has aged out of the node's ledger retention.