Open
Labels
Milestone
Description
What is the problem you are having with rclone?
I have 4 files in the source directory.
ls -l /share/Photos/test1/
-rw-rw---- 1 sir_j everyone 2195171 Nov 17 16:33 IMG_0585.jpg
-rw-rw---- 1 sir_j everyone 3222491 Nov 17 16:34 IMG_0589.jpg
-rw-rw---- 1 sir_j everyone 1766089 Nov 17 16:34 IMG_0857.jpg
-rw-rw---- 1 sir_j everyone 1826124 Nov 17 16:33 IMG_0861.jpg
First run of rclone sync command actually uploads 4 files to gphotos backend
Second and other runs show me that it's gonna copy 2 files and then delete 2 files (why?)
Expected behavior is that second and other runs should actually do nothing, because there was no changes in the source directory
What is your rclone version (output from rclone version)
rclone version
rclone v1.50.1
- os/arch: linux/arm
- go version: go1.13.4
Which OS you are using and how many bits (eg Windows 7, 64 bit)
Linux QNAP 4.2.8 #2 SMP Fri Oct 25 05:27:36 CST 2019 armv7l GNU/Linux
Which cloud storage system are you using? (eg Google Drive)
Google Photos
The command you were trying to run (eg rclone copy /tmp remote:tmp)
/usr/bin/rclone sync "/share/Photos/test1" "gphoto:album/backups/test1" -v -n
2019/11/17 16:45:54 NOTICE: IMG_0585.jpg: Not copying as --dry-run
2019/11/17 16:45:54 NOTICE: IMG_0589.jpg: Not copying as --dry-run
2019/11/17 16:45:54 INFO : Google Photos path "album/backups/test1": Waiting for checks to finish
2019/11/17 16:45:54 INFO : Google Photos path "album/backups/test1": Waiting for transfers to finish
2019/11/17 16:45:54 INFO : Waiting for deletions to finish
2019/11/17 16:45:54 NOTICE: IMG_0589.JPG: Not deleting as --dry-run
2019/11/17 16:45:54 NOTICE: IMG_0585.JPG: Not deleting as --dry-run
2019/11/17 16:45:54 INFO :
Transferred: 0 / 0 Bytes, -, 0 Bytes/s, ETA -
Errors: 0
Checks: 4 / 4, 100%
Transferred: 2 / 2, 100%
Elapsed time: 0s
A log from the command with the -vv flag (eg output from rclone -vv copy /tmp remote:tmp)
/usr/bin/rclone sync "/share/Photos/test1" "gphoto:album/backups/test1" -vv -n
2019/11/17 16:46:21 DEBUG : rclone: Version "v1.50.1" starting with parameters ["/usr/bin/rclone" "sync" "/share/Photos/test1" "gphoto:album/backups/test1" "-vv" "-n"]
2019/11/17 16:46:21 DEBUG : Using config file from "/share/homes/admin/.config/rclone/rclone.conf"
2019/11/17 16:46:21 DEBUG : Google Photos path "album/backups": NewObject: remote="test1"
2019/11/17 16:46:21 DEBUG : Google Photos path "album/backups": List: dir=""
2019/11/17 16:46:41 DEBUG : Google Photos path "album/backups": >List: err=<nil>
2019/11/17 16:46:41 DEBUG : Google Photos path "album/backups": >NewObject:
2019/11/17 16:46:41 DEBUG : Google Photos path "album/backups/test1": List: dir=""
2019/11/17 16:46:42 DEBUG : Google Photos path "album/backups/test1": >List: err=<nil>
2019/11/17 16:46:42 DEBUG : IMG_0585.JPG: Size:
2019/11/17 16:46:42 DEBUG : IMG_0585.JPG: >Size:
2019/11/17 16:46:42 DEBUG : IMG_0589.JPG: Size:
2019/11/17 16:46:42 DEBUG : IMG_0589.JPG: >Size:
2019/11/17 16:46:42 DEBUG : IMG_0857.jpg: Size:
2019/11/17 16:46:42 DEBUG : IMG_0857.jpg: >Size:
2019/11/17 16:46:42 DEBUG : IMG_0861.jpg: Size:
2019/11/17 16:46:42 DEBUG : IMG_0861.jpg: >Size:
2019/11/17 16:46:42 NOTICE: IMG_0589.jpg: Not copying as --dry-run
2019/11/17 16:46:42 NOTICE: IMG_0585.jpg: Not copying as --dry-run
2019/11/17 16:46:42 DEBUG : IMG_0857.jpg: Size:
2019/11/17 16:46:42 DEBUG : IMG_0857.jpg: >Size:
2019/11/17 16:46:42 DEBUG : IMG_0861.jpg: Size:
2019/11/17 16:46:42 DEBUG : IMG_0861.jpg: >Size:
2019/11/17 16:46:42 INFO : Google Photos path "album/backups/test1": Waiting for checks to finish
2019/11/17 16:46:42 DEBUG : IMG_0857.jpg: Sizes identical
2019/11/17 16:46:42 DEBUG : IMG_0857.jpg: Unchanged skipping
2019/11/17 16:46:42 DEBUG : IMG_0861.jpg: Sizes identical
2019/11/17 16:46:42 DEBUG : IMG_0861.jpg: Unchanged skipping
2019/11/17 16:46:42 INFO : Google Photos path "album/backups/test1": Waiting for transfers to finish
2019/11/17 16:46:42 INFO : Waiting for deletions to finish
2019/11/17 16:46:42 DEBUG : IMG_0585.JPG: Size:
2019/11/17 16:46:42 DEBUG : IMG_0585.JPG: >Size:
2019/11/17 16:46:42 NOTICE: IMG_0585.JPG: Not deleting as --dry-run
2019/11/17 16:46:42 DEBUG : IMG_0589.JPG: Size:
2019/11/17 16:46:42 DEBUG : IMG_0589.JPG: >Size:
2019/11/17 16:46:42 NOTICE: IMG_0589.JPG: Not deleting as --dry-run
2019/11/17 16:46:42 INFO :
Transferred: 0 / 0 Bytes, -, 0 Bytes/s, ETA -
Errors: 0
Checks: 4 / 4, 100%
Transferred: 2 / 2, 100%
Elapsed time: 0s
2019/11/17 16:46:42 DEBUG : 4 go routines active
2019/11/17 16:46:42 DEBUG : rclone: Version "v1.50.1" finishing with parameters ["/usr/bin/rclone" "sync" "/share/Photos/test1" "gphoto:album/backups/test1" "-vv" "-n"]
Activity
ncw commentedon Nov 17, 2019
I tried to replicate this but I couldn't.
What do you get if you do
rclone lsf gphoto:album/backups/test1does it show the 4 files?I wonder if you have a duplicate there which has
{id}appended onto it - that would probably explain the symptoms.sergey-brutsky commentedon Nov 17, 2019
After a lot of experiments I found the root cause of the issue.
The problem is that Google Photos doesn't have such domain object as "folder" they operate just with photos and tags.
Let's consider the following situation:
There is a folder let's say "test1" it contains 2 files
a.jpgandb.jpgAnd we successfully synced this folder to gphoto:albums/test1 folder (this is not true, this is just a tag)
Now we decided to create another folder "test2" and copied to this folder files
a.jpgandb.jpgfrom folder "test1"Now in the folder "test2" we renamed
a.jpgtoaaa.jpgAnd we are trying to run rclone sync test2 to gphoto:albums/test2
Google Photos somehow detects that
aaa.jpgis actuallya.jpgand after syncing in remote backendwe will have
a.jpgandb.jpginstead ofaaa.jpgandb.jpgAnd this leads to the problems with syncing, because rclone tries to sync files
aaa.jpgandb.jpgbut actually it sees in remote filesa.jpgandb.jpgso it will try to removea.jpgand uploadaaa.jpgeverytime we run sync process.@ncw could you please advise any fix for this behavior ?
ncw commentedon Nov 20, 2019
Wow! I think I'd noticed that during testing but somehow erased it from my mind...
What would you think if rclone added metadata to the
descriptionof the photo?I wonder if adding a different description to the photo would cause it to be de-duplicated... no is the answer to that question (I just tried).
I guess rclone could adjust the description with the name mapping for the new album... no that won't work - there is no api for changing the description of an image.
Rclone could certainly notice that the filename it uploaded was different to the filename received back after the upload so there is an opportunity to do something, I'm just not sure what... At minimum rclone could emit a warning.
rclone could store the renamed image mappings locally in a cache. This will go very wrong on a new computer so I'm not a big fan of this.
There are some other things like enrichments which can be added to albums but you don't seem to be able to read them back via the API.
Any other ideas?
sergey-brutsky commentedon Nov 20, 2019
From my perspective the most convinient way to mitigate this is to emit a warning like
You tried to upoad file
aaa.jpgbut it looks like this file was already uploaded asa.jpgAnd in the ideal case rclone could introduce a new gphoto flag like
--rename-local-file-after-syncing-to-gphoto.So my local file names are in sync with remote file names and
synccommand will work as expected.Does it makes sense ?