Skip to content

Commit

Permalink
Improve snapshot dir error message (hyperledger#2530)
Browse files Browse the repository at this point in the history
Users upgrading to v2.3 don't always know to configure ledger.snapshots.rootDir.
In cases where peer doesn't have write access to this directory,
the error message now mentions the property to configure.

Signed-off-by: David Enyeart <[email protected]>
  • Loading branch information
denyeart authored and AllFi committed Jul 15, 2021
1 parent b9884e8 commit 1fdb3a4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/ledger/kvledger/kv_ledger_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,10 +251,10 @@ func (p *Provider) initSnapshotDir() error {
return errors.Wrapf(err, "error while deleting the dir: %s", inProgressSnapshotsPath)
}
if err := os.MkdirAll(inProgressSnapshotsPath, 0755); err != nil {
return errors.Wrapf(err, "error while creating the dir: %s", inProgressSnapshotsPath)
return errors.Wrapf(err, "error while creating the dir: %s, ensure peer has write access to configured ledger.snapshots.rootDir directory", inProgressSnapshotsPath)
}
if err := os.MkdirAll(completedSnapshotsPath, 0755); err != nil {
return errors.Wrapf(err, "error while creating the dir: %s", completedSnapshotsPath)
return errors.Wrapf(err, "error while creating the dir: %s, ensure peer has write access to configured ledger.snapshots.rootDir directory", completedSnapshotsPath)
}
return fileutil.SyncDir(snapshotsRootDir)
}
Expand Down

0 comments on commit 1fdb3a4

Please sign in to comment.