hyperledger/fabric · error
BlockStore for %s does not exist. Aborting identifytxs
Error message
BlockStore for %s does not exist. Aborting identifytxs
What it means
IdentifyTxs needs to read blocks from the peer's block store for the ledger named in the diff records. It first checks blockStoreProvider.Exists for the ledger id; if no block store exists for that ledger id the tool aborts with this error.
Source
Thrown at internal/ledgerutil/identifytxs/identifytxs.go:81
// Get recordsMap from json
inputKeyMapWrapper, err := generateRecordsMap(records.DiffRecords, outputDirPath)
if err != nil {
return 0, 0, err
}
// Set up block store and block iterator in preparation for traversal
blockStoreProvider, err := getBlockStoreProvider(fsPath)
if err != nil {
return 0, 0, err
}
defer blockStoreProvider.Close()
blockStoreExists, err := blockStoreProvider.Exists(records.Ledgerid)
if err != nil {
return 0, 0, err
}
if !blockStoreExists {
return 0, 0, errors.Errorf("BlockStore for %s does not exist. Aborting identifytxs", records.Ledgerid)
}
blockStore, err := blockStoreProvider.Open(records.Ledgerid)
if err != nil {
return 0, 0, err
}
// Identify relevant transactions and write to json
firstBlock, lastBlock, err := findAndWriteTxs(blockStore, inputKeyMapWrapper)
if err != nil {
return 0, 0, err
}
return firstBlock, lastBlock, nil
}
// compKey represents a composite key which is simply a namespace and key pair
type compKey struct {
namespace, collection, key stringView on GitHub (pinned to 2736b63f8f)
Solutions
- Run the tool against the peer filesystem that actually hosts the block store for the ledger named in the JSON
- Confirm the ledger id matches an existing channel on the peer (ledgerData/chains/<ledgerid>)
- Regenerate the diff JSON from the correct ledger so records.Ledgerid is right
Example fix
// before ledgerutil identifytxs ./diff-from-channelA.json ./peerB-data // after (channelA lives on peerA) ledgerutil identifytxs ./diff-from-channelA.json ./peerA-data
Defensive patterns
Strategy: validation
Validate before calling
// Go: check the ledger's block store exists under the peer data dir before running
ledgerID := "mychannel"
if _, err := os.Stat(filepath.Join(peerDataDir, "ledgersData", "chains", "chains", ledgerID)); os.IsNotExist(err) {
return fmt.Errorf("no block store for ledger %s under %s", ledgerID, peerDataDir)
} Try / catch
if _, _, err := ledgerutil.IdentifyTxs(recPath, peerDataDir); err != nil {
if strings.Contains(err.Error(), "BlockStore for") {
return fmt.Errorf("run against the peer data directory that hosts this ledger: %w", err)
}
return err
} Prevention
- Verify the diff JSON's ledgerid matches a channel present on the target peer
- Point the tool at the correct peer's data directory
- Check ledgerData/chains listing before running offline tools
When it happens
Trigger: Running identifytxs against a peer data directory that has no ledger with the id recorded in the diff JSON (records.Ledgerid) — e.g. wrong peer filesystem, dropped channel, or renamed ledger.
Common situations: Running the utility on a different peer than the one that owns the ledger; channel was purged from the peer; typo or differing ledger/channel id between the snapshot/compare output and the peer data.
Related errors
- no records were read. JSON record list is either empty or no
- %s already exists in %s. Choose a different location or remo
- invalid input json. Each record entry must contain both a "n
- invalid input json. Contains duplicate record for {"namespa
- provided path %s is empty. Aborting identifytxs
AI-assisted analysis of hyperledger/fabric@2736b63f8f (2026-09-04).
Data as JSON: /api/errors/ccd18d6e77cd6232.
Report an issue: GitHub.