{"record":{"id":"3c6b893bd7069f47","repo":"hyperledger/fabric","slug":"failed-to-read-bootstrappingsnapshotinfo-file-unde","errorCode":null,"errorMessage":"failed to read bootstrappingSnapshotInfo file under blockstore directory %s","messagePattern":"failed to read bootstrappingSnapshotInfo file under blockstore directory (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"common/ledger/blkstorage/blockfile_helper.go","lineNumber":195,"sourceCode":"\t}\n\tif err != nil {\n\t\treturn nil, errors.Wrapf(err, \"error while reading bootstrappingSnapshotInfo file\")\n\t}\n\tbsi := &BootstrappingSnapshotInfo{}\n\tif err := proto.Unmarshal(bsiBytes, bsi); err != nil {\n\t\treturn nil, errors.Wrapf(err, \"error while unmarshalling bootstrappingSnapshotInfo\")\n\t}\n\treturn bsi, nil\n}\n\nfunc IsBootstrappedFromSnapshot(blockStorageDir, ledgerID string) (bool, error) {\n\tledgerDir := filepath.Join(blockStorageDir, ChainsDir, ledgerID)\n\t_, err := os.Stat(filepath.Join(ledgerDir, bootstrappingSnapshotInfoFile))\n\tif os.IsNotExist(err) {\n\t\treturn false, nil\n\t}\n\tif err != nil {\n\t\treturn false, errors.Wrapf(err, \"failed to read bootstrappingSnapshotInfo file under blockstore directory %s\", ledgerDir)\n\t}\n\treturn true, nil\n}\n\nfunc GetLedgersBootstrappedFromSnapshot(blockStorageDir string) ([]string, error) {\n\tchainsDir := filepath.Join(blockStorageDir, ChainsDir)\n\tledgerIDs, err := fileutil.ListSubdirs(chainsDir)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tisFromSnapshot := false\n\tledgersFromSnapshot := []string{}\n\tfor _, ledgerID := range ledgerIDs {\n\t\tif isFromSnapshot, err = IsBootstrappedFromSnapshot(blockStorageDir, ledgerID); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif isFromSnapshot {","sourceCodeStart":177,"sourceCodeEnd":213,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/common/ledger/blkstorage/blockfile_helper.go#L177-L213","documentation":"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.","triggerScenarios":"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.","commonSituations":"Directory listing tools calling GetLedgersBootstrappedFromSnapshot against a ledger dir with restrictive permissions; storage device errors; partially removed ledger directories.","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"],"exampleFix":"// before: calling with wrong storage root\n// IsBootstrappedFromSnapshot(\"/wrong/path\", ledgerID)\n// after: use the peer's configured fileLedger/ledgersData root\n// IsBootstrappedFromSnapshot(\"/var/hyperledger/production/ledgersData/chains\", ledgerID)","handlingStrategy":"validation","validationCode":"dir := filepath.Join(blockStorageDir, \"chains\", ledgerID)\nif fi, err := os.Stat(filepath.Join(dir, \"bootstrappingSnapshotInfo\")); err != nil && !os.IsNotExist(err) {\n    return fmt.Errorf(\"cannot inspect ledger dir %s: %w\", dir, err)\n}","typeGuard":"func ledgerInspectable(blockStorageDir, ledgerID string) bool {\n    _, err := os.Stat(filepath.Join(blockStorageDir, \"chains\", ledgerID, \"bootstrappingSnapshotInfo\"))\n    return err == nil || os.IsNotExist(err)\n}","tryCatchPattern":"ok, err := IsBootstrappedFromSnapshot(dir, ledgerID)\nif err != nil {\n    logger.Warnf(\"snapshot check failed for %s: %v\", ledgerID, err)\n    ok = false\n}","preventionTips":["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"],"tags":["filesystem","permissions","snapshot"],"backgroundTag":"file-stat-failed","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"}