From 248a2206121f87551359d109d62adeb4e29d688c Mon Sep 17 00:00:00 2001 From: denyeart Date: Thu, 1 Apr 2021 13:47:28 -0400 Subject: [PATCH] Improve snapshot dir error message (#2530) 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 --- core/ledger/kvledger/kv_ledger_provider.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/ledger/kvledger/kv_ledger_provider.go b/core/ledger/kvledger/kv_ledger_provider.go index 2c197661de0..ae28e2ff7a2 100644 --- a/core/ledger/kvledger/kv_ledger_provider.go +++ b/core/ledger/kvledger/kv_ledger_provider.go @@ -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) }