Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zero length in prior Path2 list file for first-sync to sftp remote #46

Closed
jayjlawrence opened this issue Apr 4, 2020 · 1 comment
Closed

Comments

@jayjlawrence
Copy link

Please see the following run log:

+ Projects/rclonesync-V2/rclonesync.py --first-sync --rc-verbose --filters-file Projects/rclonesync-V2/jjl_filters.txt MySQL turing:MySQL --rclone-args --links
2020-04-04 05:17:25,172:  ***** BiDirectional Sync for Cloud Services using rclone *****
2020-04-04 05:17:25,284:  Lock file created: </var/folders/rh/k_kvvy6d7bncx9k95tj4398c0000gp/T/rclonesync_LOCK_MySQL_turing_MySQL_>
2020-04-04 05:17:25,284:  Synching Path1  <MySQL/>  with Path2  <turing:MySQL/>
2020-04-04 05:17:25,285:  Command args: <Path1=MySQL, Path2=turing:MySQL, check_access=False, check_filename=RCLONE_TEST, config=None, dry_run=False, filters_file=Projects/rclonesync-V2/jjl_filters.txt, first_sync=True, force=False, max_deletes=50, no_datetime_log=False, rc_verbose=1, rclone=rclone, rclone_args==[--links], remove_empty_directories=False, verbose=False, workdir=/Users/jaylawrence/.rclonesyncwd>
2020-04-04 05:17:25,285:  Using filters-file  <Projects/rclonesync-V2/jjl_filters.txt>
2020-04-04 05:17:25,285:  Storing filters-file hash to <Projects/rclonesync-V2/jjl_filters.txt-MD5>
2020-04-04 05:17:26,004:  >>>>> --first-sync copying any unique Path2 files to Path1
2020-04-04 05:17:29,228:    ERROR    Zero length in prior Path2 list file </Users/jaylawrence/.rclonesyncwd/LSL_MySQL_turing_MySQL__Path2> -
2020-04-04 05:17:29,233:  Lock file removed: </var/folders/rh/k_kvvy6d7bncx9k95tj4398c0000gp/T/rclonesync_LOCK_MySQL_turing_MySQL_>
2020-04-04 05:17:29,233:  ***** Critical Error Abort - Must run --first-sync to recover.  See README.md *****

This may be unique to SFTP hosts. It appears that the output of the rclone lsl remote:Path is empty if this directory does not exist or is empty on the remote host.

In my case this is it:

-rw-r--r--   1 jaylawrence  staff   446503  4 Apr 05:17 LSL_MySQL_turing_MySQL__Path1_NEW
-rw-r--r--   1 jaylawrence  staff        0  4 Apr 05:17 LSL_MySQL_turing_MySQL__Path2_NEW

I am submitting a proposed solution in writing as you may want to handle this in a different way. What follows are the problem spots and a simple solution. I hope this is of assistance.

Around line 327 to modify the appropriate tests to read if not first_sync and len(path2_XXX) == 0:

As well around line 432 you need to prevent a division by zero in this case. if not force and len(path2_prior) > 0 and float( etc...

@cjnaz
Copy link
Owner

cjnaz commented Apr 4, 2020

It appears that turing:MYSQL is empty. Per the README --first-sync section:

Note that the base directories on both the Path1 and Path2 filesystems must exist, and must contain at least one file, or rclonesync will fail. This is required for safety - that rclonesync can verify that both paths are valid. Attempting to rclonesync to an empty directory results in ERROR Zero length in prior Path list file. The fix is simply to create the missing directory and place a single file in it and rerun the --first-sync.

I would suggest that you use the --check-access feature and place your check file in this base/root directory to meet this requirement.

I'll close this for now, assuming no changes needed. Let me know if issue #44 is good to close.

@cjnaz cjnaz closed this as completed Apr 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants