{"record":{"id":"2ad0c3f5cc32190f","repo":"hyperledger/fabric","slug":"provided-path-s-is-empty-aborting-verify","errorCode":null,"errorMessage":"provided path %s is empty. Aborting verify","messagePattern":"provided path (.+?) is empty\\. Aborting verify","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/ledgerutil/verify/verify.go","lineNumber":174,"sourceCode":"func getFirstBlockNumberInLedger(info *common.BlockchainInfo) uint64 {\n\tsnapshotInfo := info.GetBootstrappingSnapshotInfo()\n\tif snapshotInfo == nil {\n\t\treturn uint64(0)\n\t}\n\n\treturn snapshotInfo.GetLastBlockInSnapshot() + uint64(1)\n}\n\n// getBlockStoreProvider - Gets a default block store provider to access the peer's block store\nfunc getBlockStoreProvider(fsPath string) (*blkstorage.BlockStoreProvider, error) {\n\t// Format path to block store\n\tblockStorePath := kvledger.BlockStorePath(filepath.Join(fsPath, ledgersDataDirName))\n\tisEmpty, err := fileutil.DirEmpty(blockStorePath)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif isEmpty {\n\t\treturn nil, errors.Errorf(\"provided path %s is empty. Aborting verify\", fsPath)\n\t}\n\t// Default fields for block store provider\n\tconf := blkstorage.NewConf(blockStorePath, 0)\n\tindexConfig := &blkstorage.IndexConfig{\n\t\tAttrsToIndex: []blkstorage.IndexableAttr{\n\t\t\tblkstorage.IndexableAttrBlockNum,\n\t\t\tblkstorage.IndexableAttrBlockHash,\n\t\t\tblkstorage.IndexableAttrTxID,\n\t\t\tblkstorage.IndexableAttrBlockNumTranNum,\n\t\t},\n\t}\n\tmetricsProvider := &disabled.Provider{}\n\t// Create new block store provider\n\tblockStoreProvider, err := blkstorage.NewProvider(conf, indexConfig, metricsProvider)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n","sourceCodeStart":156,"sourceCodeEnd":192,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/internal/ledgerutil/verify/verify.go#L156-L192","documentation":"getBlockStorePath computes the block store path from the user-supplied filesystem path and checks it with fileutil.DirEmpty. If the directory is empty there are no blocks to verify, so verification aborts with this message naming the provided path.","triggerScenarios":"Running VerifyLedger (peer node verify-ledger) with --path pointing at an empty directory — e.g. a fresh/empty data folder, or a path missing the ledgersData subtree contents.","commonSituations":"Typo in the path, verifying before the peer has ever committed blocks, pointing at a mounted-but-not-populated volume, or running against a peer whose data dir was just reset.","solutions":["Point --path at the peer's actual data directory containing ledgersData (typically /var/hyperledger/production/ledgersData or a copy of it)","Verify the directory is not empty with ls before running verification","If the ledger was intentionally reset, re-sync the peer from orderers before verifying","Fix volume mounts/persistent volume claims if data was expected but is missing"],"exampleFix":"// before\npeer node verify-ledger --path /tmp/empty-dir\n// after\npeer node verify-ledger --path /var/hyperledger/production/ledgersData","handlingStrategy":"validation","validationCode":"const fs = require('fs');\nfunction assertPathNonEmpty(p) {\n  const st = fs.statSync(p);\n  if (!st.isDirectory()) throw new Error(`${p} is not a directory`);\n  if (fs.readdirSync(p).length === 0) throw new Error(`${p} is empty`);\n}\nassertPathNonEmpty('/var/hyperledger/production/ledgersData');","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Script a pre-check that the target dir contains ledgersData before running verify","Use absolute, documented paths for peer data directories","After peer node reset, expect this error until blocks are re-synced","Verify volume mounts before automated verification jobs"],"tags":["ledger","configuration","fabric"],"backgroundTag":"invalid-path-argument","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"}