{"record":{"id":"ccd18d6e77cd6232","repo":"hyperledger/fabric","slug":"blockstore-for-s-does-not-exist-aborting-identif","errorCode":null,"errorMessage":"BlockStore for %s does not exist. Aborting identifytxs","messagePattern":"BlockStore for (.+?) does not exist\\. Aborting identifytxs","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/ledgerutil/identifytxs/identifytxs.go","lineNumber":81,"sourceCode":"\t// Get recordsMap from json\n\tinputKeyMapWrapper, err := generateRecordsMap(records.DiffRecords, outputDirPath)\n\tif err != nil {\n\t\treturn 0, 0, err\n\t}\n\n\t// Set up block store and block iterator in preparation for traversal\n\tblockStoreProvider, err := getBlockStoreProvider(fsPath)\n\tif err != nil {\n\t\treturn 0, 0, err\n\t}\n\tdefer blockStoreProvider.Close()\n\n\tblockStoreExists, err := blockStoreProvider.Exists(records.Ledgerid)\n\tif err != nil {\n\t\treturn 0, 0, err\n\t}\n\tif !blockStoreExists {\n\t\treturn 0, 0, errors.Errorf(\"BlockStore for %s does not exist. Aborting identifytxs\", records.Ledgerid)\n\t}\n\tblockStore, err := blockStoreProvider.Open(records.Ledgerid)\n\tif err != nil {\n\t\treturn 0, 0, err\n\t}\n\n\t// Identify relevant transactions and write to json\n\tfirstBlock, lastBlock, err := findAndWriteTxs(blockStore, inputKeyMapWrapper)\n\tif err != nil {\n\t\treturn 0, 0, err\n\t}\n\n\treturn firstBlock, lastBlock, nil\n}\n\n// compKey represents a composite key which is simply a namespace and key pair\ntype compKey struct {\n\tnamespace, collection, key string","sourceCodeStart":63,"sourceCodeEnd":99,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/internal/ledgerutil/identifytxs/identifytxs.go#L63-L99","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"// before\nledgerutil identifytxs ./diff-from-channelA.json ./peerB-data\n// after (channelA lives on peerA)\nledgerutil identifytxs ./diff-from-channelA.json ./peerA-data","handlingStrategy":"validation","validationCode":"// Go: check the ledger's block store exists under the peer data dir before running\nledgerID := \"mychannel\"\nif _, err := os.Stat(filepath.Join(peerDataDir, \"ledgersData\", \"chains\", \"chains\", ledgerID)); os.IsNotExist(err) {\n    return fmt.Errorf(\"no block store for ledger %s under %s\", ledgerID, peerDataDir)\n}","typeGuard":null,"tryCatchPattern":"if _, _, err := ledgerutil.IdentifyTxs(recPath, peerDataDir); err != nil {\n    if strings.Contains(err.Error(), \"BlockStore for\") {\n        return fmt.Errorf(\"run against the peer data directory that hosts this ledger: %w\", err)\n    }\n    return err\n}","preventionTips":["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"],"tags":["hyperledger-fabric","ledgerutil","blockstore","missing-ledger"],"backgroundTag":"ledger-store-not-found","analyzedSha":"2736b63f8fd5932511d56fe68b7039d15977f7f6","analyzedAt":"2026-09-04T08:52:36.465Z","contentChangedAt":"2026-09-04T08:52:36.465Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}