"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files
Go azure-blobazure-blob-storageazure-filesbackblaze-b2cloud-storagedropboxencryptionftpfuse-filesystemgogolanggoogle-cloud-storagegoogle-driveonedriveopenstack-swiftrclones3sftpsyncwebdav
bisync: provide more info in critical error msgs
nielash4d5d6ee61b2f
diff --git a/cmd/bisync/bisync_test.go b/cmd/bisync/bisync_test.goindex 185981a2c..d0ce2e225 100644--- a/cmd/bisync/bisync_test.go+++ b/cmd/bisync/bisync_test.go@@ -1231,6 +1231,7 @@ func (b *bisyncTest) newReplacer(mangle bool) *strings.Replacer {"//?/" + strings.TrimSuffix(strings.Replace(b.path2, slash, "/", -1), "/"), "{path2}",strings.TrimSuffix(b.path1, slash), "{path1}", // ensure it's still recognized without trailing slashstrings.TrimSuffix(b.path2, slash), "{path2}",+ b.workDir, "{workdir}",b.sessionName, "{session}",}if fixSlash {diff --git a/cmd/bisync/operations.go b/cmd/bisync/operations.goindex 00d879dbc..a49aa6442 100644--- a/cmd/bisync/operations.go+++ b/cmd/bisync/operations.go@@ -98,7 +98,10 @@ func Bisync(ctx context.Context, fs1, fs2 fs.Fs, optArg *Options) (err error) {if !opt.DryRun {lockFile = b.basePath + ".lck"if bilib.FileExists(lockFile) {- return fmt.Errorf("prior lock file found: %s", lockFile)+ errTip := Color(terminal.MagentaFg, "Tip: this indicates that another bisync run (of these same paths) either is still running or was interrupted before completion. \n")+ errTip += Color(terminal.MagentaFg, "If you're SURE you want to override this safety feature, you can delete the lock file with the following command, then run bisync again: \n")+ errTip += fmt.Sprintf(Color(terminal.HiRedFg, "rclone deletefile \"%s\""), lockFile)+ return fmt.Errorf(Color(terminal.RedFg, "prior lock file found: %s \n")+errTip, Color(terminal.HiYellowFg, lockFile))}pidStr := []byte(strconv.Itoa(os.Getpid()))@@ -222,7 +225,13 @@ func (b *bisyncRun) runLocked(octx context.Context) (err error) {// On prior critical error abort, the prior listings are renamed to .lst-err to lock out further runsb.critical = trueb.retryable = true- return errors.New("cannot find prior Path1 or Path2 listings, likely due to critical error on prior run")+ errTip := Color(terminal.MagentaFg, "Tip: here are the filenames we were looking for. Do they exist? \n")+ errTip += fmt.Sprintf(Color(terminal.CyanFg, "Path1: %s\n"), Color(terminal.HiBlueFg, b.listing1))+ errTip += fmt.Sprintf(Color(terminal.CyanFg, "Path2: %s\n"), Color(terminal.HiBlueFg, b.listing2))+ errTip += Color(terminal.MagentaFg, "Try running this command to inspect the work dir: \n")+ errTip += fmt.Sprintf(Color(terminal.HiCyanFg, "rclone lsl \"%s\""), b.workDir)++ return errors.New("cannot find prior Path1 or Path2 listings, likely due to critical error on prior run \n" + errTip)}fs.Infof(nil, "Building Path1 and Path2 listings")@@ -526,6 +535,9 @@ func (b *bisyncRun) checkAccess(checkFiles1, checkFiles2 bilib.Names) error {numChecks1 := len(checkFiles1)numChecks2 := len(checkFiles2)if numChecks1 == 0 || numChecks1 != numChecks2 {+ if numChecks1 == 0 && numChecks2 == 0 {+ fs.Logf("--check-access", Color(terminal.RedFg, "Failed to find any files named %s\n More info: %s"), Color(terminal.CyanFg, opt.CheckFilename), Color(terminal.BlueFg, "https://rclone.org/bisync/#check-access"))+ }fs.Errorf(nil, "%s Path1 count %d, Path2 count %d - %s", prefix, numChecks1, numChecks2, opt.CheckFilename)ok = false}diff --git a/cmd/bisync/testdata/test_check_access/golden/test.log b/cmd/bisync/testdata/test_check_access/golden/test.logindex 39d7452a7..2b8e6c982 100644--- a/cmd/bisync/testdata/test_check_access/golden/test.log+++ b/cmd/bisync/testdata/test_check_access/golden/test.log@@ -83,7 +83,12 @@ Bisync error: bisync aborted[36m(19) :[0m [34mtest 6. run again. should fail critical due to missing listings.[0m[36m(20) :[0m [34mbisync check-access[0mINFO : Synching Path1 "{path1/}" with Path2 "{path2/}"-ERROR : [31mBisync critical error: cannot find prior Path1 or Path2 listings, likely due to critical error on prior run[0m+ERROR : [31mBisync critical error: cannot find prior Path1 or Path2 listings, likely due to critical error on prior run+[35mTip: here are the filenames we were looking for. Do they exist?+[0m[36mPath1: [94m{workdir/}{session}.path1.lst[0m+[0m[36mPath2: [94m{workdir/}{session}.path2.lst[0m+[0m[35mTry running this command to inspect the work dir:+[0m[96mrclone lsl "{workdir}"[0m[0mERROR : [31mBisync aborted. Must run --resync to recover.[0mBisync error: bisync aborted[36m(21) :[0m [34mmove-listings missing-listings[0mdiff --git a/cmd/bisync/testdata/test_check_sync/golden/test.log b/cmd/bisync/testdata/test_check_sync/golden/test.logindex f971b6d1d..edc5c221f 100644--- a/cmd/bisync/testdata/test_check_sync/golden/test.log+++ b/cmd/bisync/testdata/test_check_sync/golden/test.log@@ -32,7 +32,12 @@ Bisync error: bisync aborted[36m(12) :[0m [34mtest 4. run normal sync to check that it aborts[0m[36m(13) :[0m [34mbisync[0mINFO : Synching Path1 "{path1/}" with Path2 "{path2/}"-ERROR : [31mBisync critical error: cannot find prior Path1 or Path2 listings, likely due to critical error on prior run[0m+ERROR : [31mBisync critical error: cannot find prior Path1 or Path2 listings, likely due to critical error on prior run+[35mTip: here are the filenames we were looking for. Do they exist?+[0m[36mPath1: [94m{workdir/}{session}.path1.lst[0m+[0m[36mPath2: [94m{workdir/}{session}.path2.lst[0m+[0m[35mTry running this command to inspect the work dir:+[0m[96mrclone lsl "{workdir}"[0m[0mERROR : [31mBisync aborted. Must run --resync to recover.[0mBisync error: bisync aborteddiff --git a/cmd/bisync/testdata/test_filtersfile_checks/golden/test.log b/cmd/bisync/testdata/test_filtersfile_checks/golden/test.logindex 4685d005e..2e099b9f6 100644--- a/cmd/bisync/testdata/test_filtersfile_checks/golden/test.log+++ b/cmd/bisync/testdata/test_filtersfile_checks/golden/test.log@@ -24,7 +24,12 @@ Bisync error: bisync aborted[36m(08) :[0m [34mtest 3. run without filters-file. should be blocked due to prior abort.[0m[36m(09) :[0m [34mbisync[0mINFO : Synching Path1 "{path1/}" with Path2 "{path2/}"-ERROR : [31mBisync critical error: cannot find prior Path1 or Path2 listings, likely due to critical error on prior run[0m+ERROR : [31mBisync critical error: cannot find prior Path1 or Path2 listings, likely due to critical error on prior run+[35mTip: here are the filenames we were looking for. Do they exist?+[0m[36mPath1: [94m{workdir/}{session}.path1.lst[0m+[0m[36mPath2: [94m{workdir/}{session}.path2.lst[0m+[0m[35mTry running this command to inspect the work dir:+[0m[96mrclone lsl "{workdir}"[0m[0mERROR : [31mBisync aborted. Must run --resync to recover.[0mBisync error: bisync aborted