hyperledger/fabric · error
failed to read bootstrappingSnapshotInfo file under blocksto
Error message
failed to read bootstrappingSnapshotInfo file under blockstore directory %s
What it means
IsBootstrappedFromSnapshot stats bootstrappingSnapshotInfoFile under the ledger's dir; NotExist means false, but any other stat error is wrapped into this error and returned to callers like GetLedgersBootstrappedFromSnapshot. It signals the ledger dir or file is present but not statable.
Source
Thrown at common/ledger/blkstorage/blockfile_helper.go:195
}
if err != nil {
return nil, errors.Wrapf(err, "error while reading bootstrappingSnapshotInfo file")
}
bsi := &BootstrappingSnapshotInfo{}
if err := proto.Unmarshal(bsiBytes, bsi); err != nil {
return nil, errors.Wrapf(err, "error while unmarshalling bootstrappingSnapshotInfo")
}
return bsi, nil
}
func IsBootstrappedFromSnapshot(blockStorageDir, ledgerID string) (bool, error) {
ledgerDir := filepath.Join(blockStorageDir, ChainsDir, ledgerID)
_, err := os.Stat(filepath.Join(ledgerDir, bootstrappingSnapshotInfoFile))
if os.IsNotExist(err) {
return false, nil
}
if err != nil {
return false, errors.Wrapf(err, "failed to read bootstrappingSnapshotInfo file under blockstore directory %s", ledgerDir)
}
return true, nil
}
func GetLedgersBootstrappedFromSnapshot(blockStorageDir string) ([]string, error) {
chainsDir := filepath.Join(blockStorageDir, ChainsDir)
ledgerIDs, err := fileutil.ListSubdirs(chainsDir)
if err != nil {
return nil, err
}
isFromSnapshot := false
ledgersFromSnapshot := []string{}
for _, ledgerID := range ledgerIDs {
if isFromSnapshot, err = IsBootstrappedFromSnapshot(blockStorageDir, ledgerID); err != nil {
return nil, err
}
if isFromSnapshot {View on GitHub (pinned to 2736b63f8f)
Solutions
- Fix permissions on the ledger directory (chown/chmod to the peer user)
- Remove stale/broken ledger directories that are partially deleted
- Check storage mount health and retry
Example fix
// before: calling with wrong storage root
// IsBootstrappedFromSnapshot("/wrong/path", ledgerID)
// after: use the peer's configured fileLedger/ledgersData root
// IsBootstrappedFromSnapshot("/var/hyperledger/production/ledgersData/chains", ledgerID) Defensive patterns
Strategy: validation
Validate before calling
dir := filepath.Join(blockStorageDir, "chains", ledgerID)
if fi, err := os.Stat(filepath.Join(dir, "bootstrappingSnapshotInfo")); err != nil && !os.IsNotExist(err) {
return fmt.Errorf("cannot inspect ledger dir %s: %w", dir, err)
} Type guard
func ledgerInspectable(blockStorageDir, ledgerID string) bool {
_, err := os.Stat(filepath.Join(blockStorageDir, "chains", ledgerID, "bootstrappingSnapshotInfo"))
return err == nil || os.IsNotExist(err)
} Try / catch
ok, err := IsBootstrappedFromSnapshot(dir, ledgerID)
if err != nil {
logger.Warnf("snapshot check failed for %s: %v", ledgerID, err)
ok = false
} Prevention
- Run directory-inspection tooling as the peer user
- Clean up partially removed ledger directories promptly
- Pass the correct block storage root (ledgersData), not an ad-hoc path
When it happens
Trigger: os.Stat fails with a non-NotExist error (permission denied, I/O error, symlink loop) when checking whether a ledger was bootstrapped from a snapshot.
Common situations: Directory listing tools calling GetLedgersBootstrappedFromSnapshot against a ledger dir with restrictive permissions; storage device errors; partially removed ledger directories.
Related errors
- error while reading bootstrappingSnapshotInfo file
- error while deleting the dir: %s
- error while creating the dir: %s, ensure peer has write acce
- error while creating temp dir [%s]
- error while creating final dir for snapshot:%s
AI-assisted analysis of hyperledger/fabric@2736b63f8f (2026-09-04).
Data as JSON: /api/errors/3c6b893bd7069f47.
Report an issue: GitHub.