Skip to content

Commit

Permalink
Improve snapshot dir error message
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 committed Apr 1, 2021
1 parent 3714ca3 commit c7dc5d7
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, 0o755); 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, 0o755); 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 c7dc5d7

Please sign in to comment.