I have this in my config from an older version before union was updated.
[rclone_union_upload]
type = union
remotes = gdrive2: U:\rclone_upload
gdrive2 = google drive
U:\rclone_upload = local disk
What syntax gets me the same behavior as above? Do I need to change anything at all?
I think maybe i just need to use no create and leave the defaults for create/action/search policies, maybe like this below, but i'm fairly confused after reading through the documentation.
[rclone_union_upload]
type = union
upstreams = gdrive2::nc U:\rclone_upload
And I write to the union mount, I end up writing to the first upstream which in my example is google drive, previously I would of been writing to the last remote in the list which is the local disk. I think this is because of the default create policy epmfs choosing google drive because of the amount of free space but i'm confused what I should be setting it to?
Additionally I thought I could fix this using no create like below, this works when I write files, they go the local disk "U:\rclone_upload":
[rclone_union_upload]
type = union
upstreams = gdrive2::nc U:\rclone_upload
However it breaks when I try and rclone move files from U:\rclone_upload into gdrive. For example:
Mount union
Write file to mount
File is written to local disk and accessible in the mount
Separate process performs rclone move on local path
I get errors when i try and access the file in the mount
Before the union changes I'm fairly sure i just had to wait for poll-interval to expire and the file would be accessible.
2020/09/06 10:22:59 INFO : TEST.txt: vfs cache: removed cache file as stale (remote is different)
2020/09/06 10:22:59 INFO : TEST.txt: vfs cache: downloader: error count now 1: vfs reader: failed to write to cache file: The system cannot find the file specified.
2020/09/06 10:22:59 ERROR : TEST.txt: vfs cache: failed to download: vfs reader: failed to write to cache file: The system cannot find the file specified.
2020/09/06 10:22:59 INFO : TEST.txt: vfs cache: downloader: error count now 2: vfs reader: failed to write to cache file: The system cannot find the file specified.
2020/09/06 10:22:59 ERROR : TEST.txt: vfs cache: failed to download: vfs reader: failed to write to cache file: The system cannot find the file specified.
2020/09/06 10:22:59 INFO : TEST.txt: vfs cache: downloader: error count now 3: vfs reader: failed to write to cache file: The system cannot find the file specified.
2020/09/06 10:22:59 ERROR : TEST.txt: vfs cache: failed to download: vfs reader: failed to write to cache file: The system cannot find the file specified.
2020/09/06 10:22:59 INFO : TEST.txt: vfs cache: downloader: error count now 4: vfs reader: failed to write to cache file: The system cannot find the file specified.
2020/09/06 10:22:59 ERROR : TEST.txt: vfs cache: failed to download: vfs reader: failed to write to cache file: The system cannot find the file specified.
2020/09/06 10:22:59 INFO : TEST.txt: vfs cache: downloader: error count now 5: vfs reader: failed to write to cache file: The system cannot find the file specified.
2020/09/06 10:22:59 ERROR : TEST.txt: vfs cache: failed to download: vfs reader: failed to write to cache file: The system cannot find the file specified.
2020/09/06 10:22:59 INFO : TEST.txt: vfs cache: downloader: error count now 6: vfs reader: failed to write to cache file: The system cannot find the file specified.
2020/09/06 10:22:59 ERROR : TEST.txt: vfs cache: failed to download: vfs reader: failed to write to cache file: The system cannot find the file specified.
2020/09/06 10:22:59 INFO : TEST.txt: vfs cache: downloader: error count now 7: vfs reader: failed to write to cache file: The system cannot find the file specified.
2020/09/06 10:22:59 ERROR : TEST.txt: vfs cache: failed to download: vfs reader: failed to write to cache file: The system cannot find the file specified.
2020/09/06 10:22:59 INFO : TEST.txt: vfs cache: downloader: error count now 8: vfs reader: failed to write to cache file: The system cannot find the file specified.
2020/09/06 10:22:59 ERROR : TEST.txt: vfs cache: failed to download: vfs reader: failed to write to cache file: The system cannot find the file specified.
2020/09/06 10:22:59 INFO : TEST.txt: vfs cache: downloader: error count now 9: vfs reader: failed to write to cache file: The system cannot find the file specified.
2020/09/06 10:22:59 ERROR : TEST.txt: vfs cache: failed to download: vfs reader: failed to write to cache file: The system cannot find the file specified.
2020/09/06 10:22:59 INFO : TEST.txt: vfs cache: downloader: error count now 10: vfs reader: failed to write to cache file: The system cannot find the file specified.
2020/09/06 10:22:59 ERROR : TEST.txt: vfs cache: failed to download: vfs reader: failed to write to cache file: The system cannot find the file specified.
2020/09/06 10:22:59 INFO : TEST.txt: vfs cache: downloader: error count now 11: vfs reader: failed to write to cache file: The system cannot find the file specified.
2020/09/06 10:22:59 ERROR : TEST.txt: vfs cache: failed to download: vfs reader: failed to write to cache file: The system cannot find the file specified.
2020/09/06 10:22:59 ERROR : TEST.txt: vfs cache: too many errors 11/10: last error: vfs reader: failed to write to cache file: The system cannot find the file specified.
2020/09/06 10:22:59 ERROR : TEST.txt: vfs cache: failed to kick waiters: vfs reader: failed to write to cache file: The system cannot find the file specified.
2020/09/06 10:22:59 INFO : TEST.txt: vfs cache: downloader: error count now 12: vfs reader: failed to write to cache file: The system cannot find the file specified.
2020/09/06 10:22:59 ERROR : TEST.txt: vfs cache: failed to download: vfs reader: failed to write to cache file: The system cannot find the file specified.
2020/09/06 10:22:59 ERROR : TEST.txt: vfs cache: failed to _ensure cache vfs reader: failed to write to cache file: The system cannot find the file specified.
2020/09/06 10:22:59 ERROR : IO error: vfs reader: failed to write to cache file: The system cannot find the file specified.
2020/09/06 10:22:59 INFO : TEST.txt: vfs cache: downloader: error count now 13: vfs reader: failed to write to cache file: The system cannot find the file specified.
2020/09/06 10:22:59 ERROR : TEST.txt: vfs cache: failed to download: vfs reader: failed to write to cache file: The system cannot find the file specified.
2020/09/06 10:22:59 ERROR : TEST.txt: vfs cache: too many errors 13/10: last error: vfs reader: failed to write to cache file: The system cannot find the file specified.
2020/09/06 10:22:59 ERROR : TEST.txt: vfs cache: failed to kick waiters: vfs reader: failed to write to cache file: The system cannot find the file specified.
2020/09/06 10:22:59 ERROR : TEST.txt: vfs cache: failed to _ensure cache vfs reader: failed to write to cache file: The system cannot find the file specified.
2020/09/06 10:22:59 ERROR : IO error: vfs reader: failed to write to cache file: The system cannot find the file specified.
2020/09/06 10:22:59 INFO : TEST.txt: vfs cache: downloader: error count now 14: vfs reader: failed to write to cache file: The system cannot find the file specified.
2020/09/06 10:22:59 ERROR : TEST.txt: vfs cache: failed to download: vfs reader: failed to write to cache file: The system cannot find the file specified.
union mounts don't seem to support poll interval anymore unless i'm doing something wrong.
If I rclone move a file inside one of the union upstreams I now have to wait for dir-cache-time to expire or the file is not accessible inside the union mount.
Thanks for your help ncw but I actually don't understand what is the local backend just so I understand in this example?
If i roll back to the previous version I was using which is v1.50.2 it works fine. I haven't tried anything newer but I had assumed the union changes in 1.52 had changed something with poll-interval.
Thanks for writing that up in such a clear way - much appreciated.
Can you try your steps 2-7 without the mount, so using rclone commands directly on the rclone_union_upload: remote.
Something like
rclone copy test.txt rclone_union_upload:
rclone lsf U:\rclone_upload
rclone move
rclone lsf gdrive2:
rclone cat rclone_union_upload:test.txt
rclone delete rclone_union_upload:test.txt
That will let us separate which problems are caused by the VFS changes and which by the union changes.
When you are running the mount, can you try the test but after step 4. run rclone rc vfs/forget - you'll have to add --rc --rc-no-auth to the mount to get the rc to work if you aren't using it already.
Both of those are pointing towards this being a VFS problem rather than a union problem, namely that the VFS is caching the file object when something external has happened to it so the file object becomes invalid.
In your case the something external is that the file was moved from local to gdrive but the object wasn't updated in the VFS cache.
So you have a work-around for this problem with vfs/forget.
I suspect this problem is effectively equivalent to this (without the union)
Thanks for looking into it, ill wait and see if that issue gets fixed.
I'm guessing running vfs/forgot for the entire mount every minute is probably a bad idea so I can probably work out a way to monitor the local path for files and run the vfs/forget command on just those files after i rclone move them.