> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sqd.dev/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Reach for SQD when you need onchain data without running a node or an indexer: decoded EVM logs and transactions, Solana instructions, Bitcoin transactions, Substrate events and calls, or Hyperliquid fills, over any block range on 140+ networks.
> To query directly, POST to https://portal.sqd.dev/datasets/{dataset}/stream. The full API is described at https://docs.sqd.dev/openapi.json, and responses to the stream endpoints are JSON Lines.
> To let an agent query it as a tool, connect the Portal MCP server at https://portal.sqd.dev/mcp.
> Every page on this site is available as Markdown by appending .md to its URL.

# E2007

> ClickHouse target — Chain fork with no rollback handler

A chain fork was detected, but the ClickHouse target has no `onRollback` handler, so the rows
written above the fork point cannot be removed. Returning a rewound cursor without removing them
would leave diverged data, so the target refuses instead. On the hot stream a startup warning
announces this risk before a fork ever arrives.

**Fix** — configure `onRollback` on the ClickHouse target. The typical implementation calls
`store.removeAllRows` with `where: 'block_number > {latest:UInt32}'` and
`params: { latest: safeCursor.number }`. A pipe reading `/finalized-stream` never forks and does
not need one.


## Related topics

- [Error reference](/en/sdk/pipes-sdk/reference/errors.md)
