Union mount not updating

What is the problem you are having with rclone?

After mounting a union (made up of google drive and aws s3) it doesn't show new files created on the remote (Google Drive) until stopped and mounted again. Also creating files on this union doesn't create them on the underlying remote.

Run the command 'rclone version' and share the full output of the command.

rclone v1.62.2
- os/version: arch "rolling" (64 bit)
- os/kernel: 6.3.9-arch1-1 (x86_64)
- os/type: linux
- os/arch: amd64
- go/version: go1.20.4
- go/linking: dynamic
- go/tags: none

Which cloud storage system are you using? (eg Google Drive)

Google Drive + AWS S3 (Glacier Deep Archive)

The command you were trying to run (eg rclone copy /tmp remote:tmp)

rclone mount union: /mnt/union \
--umask 077 \
--rc --rc-addr :8239 --rc-user user --rc-pass <PASSWORD> \
--cache-dir /home/user/.cache/rclone/union \
--vfs-cache-mode full \
--vfs-cache-poll-interval 5m \
--vfs-cache-max-age 8760h \
--vfs-cache-max-size 100G \
--attr-timeout 8700h \
--dir-cache-time 8760h \
--poll-interval 10s \
--multi-thread-streams 0 \
--log-file /home/user/.config/rclone/union.log -vv

The rclone config contents with secrets removed.

[gdrive]
type = drive
client_id = <CLIENT-ID>
client_secret = <CLIENT-SECRET>
scope = drive
token = <TOKEN>
root_folder_id = <ROOT-FOLDER>
team_drive = 

[gdrive-crypt]
type = crypt
remote = gdrive:/crypt
password = <PASSWORD>
password2 = <PASSWORD2>

[aws-glacier-deep]
type = s3
provider = AWS
access_key_id = <ACCESS-KEY>
secret_access_key = <SECRET-ACCESS-KEY>
region = <REGION>
location_constraint = <REGION>
acl = private
storage_class = DEEP_ARCHIVE

[aws-glacier-deep-crypt]
type = crypt
remote = aws-glacier-deep:<BUCKET>/crypt
password = <PASSWORD>
password2 = <PASSWORD2>

[gdrive-aws-union]
type = union
upstreams = gdrive-encrypted: aws-glacier-deep-crypt:/:nc

A log from the command with the -vv flag

2023/06/27 14:35:40 DEBUG : rclone: Version "v1.62.2" starting with parameters ["rclone" "mount" "union:" "/mnt/union" "--umask" "077" "--rc" "--rc-addr" ":8239" "--rc-user" "user" "--rc-pass" "<PASSWORD>" "--cache-dir" "/home/user/.cache/rclone/union" "--vfs-cache-mode" "full" "--vfs-cache-poll-interval" "5m" "--vfs-cache-max-age" "8760h" "--vfs-cache-max-size" "100G" "--attr-timeout" "8700h" "--dir-cache-time" "8760h" "--poll-interval" "10s" "--multi-thread-streams" "0" "--log-file" "/home/user/.config/rclone/union.log" "-vv"]
2023/06/27 14:35:40 INFO  : Using --user user --pass XXXX as authenticated user
2023/06/27 14:35:40 NOTICE: Serving remote control on http://[::]:8239/
2023/06/27 14:35:40 DEBUG : Creating backend with remote "union:"
2023/06/27 14:35:40 DEBUG : Using config file from "/home/user/.config/rclone/rclone.conf"
2023/06/27 14:35:40 DEBUG : Creating backend with remote "aws-glacier-deep-crypt-overlay:/"
2023/06/27 14:35:40 DEBUG : Creating backend with remote "gdrive-crypt:"
2023/06/27 14:35:41 DEBUG : Creating backend with remote "gdrive:/crypt"
2023/06/27 14:35:41 DEBUG : Creating backend with remote "aws-glacier-deep:<BUCKET>/crypt"
2023/06/27 14:35:41 DEBUG : fs cache: renaming cache item "gdrive:/crypt" to be canonical "gdrive:crypt"
2023/06/27 14:35:41 DEBUG : union root '': actionPolicy = *policy.EpAll, createPolicy = *policy.EpMfs, searchPolicy = *policy.FF

...

rest of the log on pastebin: 2023/06/27 14:35:40 DEBUG : rclone: Version "v1.62.2" starting with parameters [ - Pastebin.com

Union remotes don't support polling.

2023/06/27 14:35:41 INFO  : union root '': poll-interval is not supported by this remote

So it won't show up for 8760 hours.

1 Like

From your log:

2023/06/27 14:35:41 INFO : union root '': poll-interval is not supported by this remote

so no point to use --poll-interval 10s

Now here is problem with upload:

2023/06/27 14:36:08 INFO  : wallpapers/surygbseukgbv: vfs cache: queuing for upload in 5s
2023/06/27 14:36:08 DEBUG : wallpapers/surygbseukgbv(0xc0005ad2c0): >close: err=<nil>
2023/06/27 14:36:08 DEBUG : &{wallpapers/surygbseukgbv (rw)}: >Release: err=<nil>
2023/06/27 14:36:13 DEBUG : wallpapers/surygbseukgbv: vfs cache: starting upload
2023/06/27 14:36:16 ERROR : wallpapers/surygbseukgbv: Failed to copy: object not found
2023/06/27 14:36:16 ERROR : wallpapers/surygbseukgbv: vfs cache: failed to upload try #1, will retry in 10s: vfs cache: failed to transfer file from cache to remote: object not found

It tries to upload new file after default vfs-write-back duration 5s but fails. I am not sure why.

What about to move crypt above union? In theory it should not make difference but maybe union has problem with stacked remotes. So:

[gdrive-aws-union]
type = union
upstreams = gdrive:crypt aws-glacier-deep:crypt:nc

[gdrive-aws-union-crypt]
type = crypt
remote = gdrive-aws-union:/crypt
password = <PASSWORD>
password2 = <PASSWORD2>

1 Like

Thank you for this suggestion. This one I was not sure.

Do you know if S3 AWS is polling remote?

Thank you, the idea of make union of encrypted remotes instead is brilliant - simplifies a lot of things. I've just tried it and it works fine, but unfortunately, the problems didn't go away. Creating files on that decrypted union still doesn't create files on the gdrive remote.

And the same error in log?

Thanks, that's good to know. Do you know if union has any other way to reflect changes on the remotes? Would it work if you kept unmounting and remounting it over some short interval?

Let's try to isolate problem. Forget crypt for a moment and mount gdrive-aws-union directly

Yes, it looks the same (log below). I will try to mount it without the options and decryption.

2023/06/27 15:37:00 NOTICE: Serving remote control on http://[::]:8239/
2023/06/27 15:37:21 ERROR : wallpapers/iserugbsielgbl: Failed to copy: object not found
2023/06/27 15:37:21 ERROR : wallpapers/iserugbsielgbl: vfs cache: failed to upload try #1, will retry in 10s: vfs cache: failed to transfer file from cache to remote: object not found
2023/06/27 15:37:38 ERROR : wallpapers/iserugbsielgbl: Failed to copy: object not found
2023/06/27 15:37:38 ERROR : wallpapers/iserugbsielgbl: vfs cache: failed to upload try #2, will retry in 20s: vfs cache: failed to transfer file from cache to remote: object not found
2023/06/27 15:38:05 ERROR : wallpapers/iserugbsielgbl: Failed to copy: object not found
2023/06/27 15:38:05 ERROR : wallpapers/iserugbsielgbl: vfs cache: failed to upload try #3, will retry in 40s: vfs cache: failed to transfer file from cache to remote: object not found
2023/06/27 15:38:50 ERROR : wallpapers/iserugbsielgbl: Failed to copy: object not found
2023/06/27 15:38:50 ERROR : wallpapers/iserugbsielgbl: vfs cache: failed to upload try #4, will retry in 1m20s: vfs cache: failed to transfer file from cache to remote: object not found
2023/06/27 15:40:13 ERROR : wallpapers/iserugbsielgbl: Failed to copy: object not found
2023/06/27 15:40:13 ERROR : wallpapers/iserugbsielgbl: vfs cache: failed to upload try #5, will retry in 2m40s: vfs cache: failed to transfer file from cache to remote: object not found

Mounted union without flags or decryption:

rclone mount gdrive-aws-union: ./ilsuegrbsierbug/ -vv

tried creating a sample file:

touch ilsuegrbsierbug/sloierbguiseg

This failed with an error:

touch: failed to close 'ilsuegrbsierbug/sloierbguiseg': No such file or directory

listing this ilsuegrbsierbug directory showed that this sloierbguiseg file was there, but after umounting and remounting this union it disappeared. It also didn't show in neither of the two encrypted remotes.

part of the log when creating that file:

<7>DEBUG : /: Attr:
<7>DEBUG : /: >Attr: attr=valid=1s ino=0 size=0 mode=drwxr-xr-x, err=<nil>
<7>DEBUG : /: Lookup: name="sloierbguiseg"
<7>DEBUG : /: >Lookup: node=<nil>, err=no such file or directory
<7>DEBUG : /: Lookup: name="sloierbguiseg"
<7>DEBUG : /: >Lookup: node=<nil>, err=no such file or directory
<7>DEBUG : /: ReadDirAll:
<7>DEBUG : /: >ReadDirAll: item=28, err=<nil>
<7>DEBUG : /: Lookup: name="sloierbguiseg"
<7>DEBUG : /: >Lookup: node=<nil>, err=no such file or directory
<7>DEBUG : /: Create: name="sloierbguiseg"
<7>DEBUG : sloierbguiseg: Open: flags=O_WRONLY|O_CREATE|0x800
<7>DEBUG : : Added virtual directory entry vAddFile: "sloierbguiseg"
<7>DEBUG : sloierbguiseg: >Open: fd=sloierbguiseg (w), err=<nil>
<7>DEBUG : /: >Create: node=sloierbguiseg, handle=&{sloierbguiseg (w)}, err=<nil>
<7>DEBUG : sloierbguiseg: Attr:
<7>DEBUG : sloierbguiseg: >Attr: a=valid=1s ino=0 size=0 mode=-rw-r--r--, err=<nil>
<7>DEBUG : &{sloierbguiseg (w)}: Flush:
<7>DEBUG : sloierbguiseg: WriteFileHandle.Flush unwritten handle, writing 0 bytes to avoid race conditions
<7>DEBUG : : Added virtual directory entry vAddFile: "sloierbguiseg"
<7>DEBUG : &{sloierbguiseg (w)}: >Flush: err=<nil>
<7>DEBUG : sloierbguiseg: Setattr: a=Setattr [ID=0x1d4 Node=0x1c Uid=1000 Gid=1000 Pid=330032] atime=2023-06-27 15:49:49.200195168 +0100 BST atime=now mtime=2023-06-27 15:49:49.200195168 +0100 BST mtime=now handle=INVALID-0x0
<7>DEBUG : sloierbguiseg: >Setattr: err=<nil>
<7>DEBUG : sloierbguiseg: Attr:
<7>DEBUG : sloierbguiseg: >Attr: a=valid=1s ino=0 size=0 mode=-rw-r--r--, err=<nil>
<7>DEBUG : &{sloierbguiseg (w)}: Flush:
<7>DEBUG : union root '': File to upload is small (0 bytes), uploading instead of streaming
<3>ERROR : sloierbguiseg: Failed to copy: object not found
<3>ERROR : sloierbguiseg: WriteFileHandle.New Rcat failed: object not found
<3>ERROR : sloierbguiseg: WriteFileHandle.Flush error: object not found
<7>DEBUG : &{sloierbguiseg (w)}: >Flush: err=no such file or directory
<7>DEBUG : &{sloierbguiseg (w)}: Release:
<7>DEBUG : sloierbguiseg: WriteFileHandle.Release nothing to do
<7>DEBUG : &{sloierbguiseg (w)}: >Release: err=<nil>

full log: ~ ❯ rclone mount gdrive-aws-union: ilsuegrbsierbug/ -vv 15:44: - Pastebin.com

hmmm

it is a bit cryptic maybe it means can't find remote to copy it to....

let's try:

change AWS to ro from nc

if still does not work

add to union config

create_policy = ff

default policy here is epmfs which requires remote to report free space (AWS does not). Maybe even with aws:nc rclone still tries to get it...

Which one worked?

Sorry, I was still testing it (and AWS policies).

create_policy = ff

worked. Both ro and nc work with it.

Still testing though - some operations don't seem to work when mounting decrypted union: you can create, delete and copy, but renaming files still doesn't work.

Would you consider it a bug in rclone? AWS may not support free space, but I think that if epmfs is a default policy it woudl be nice if rclone ignored AWS and carried over other remotes that support it?

Sorry, I've initially tagged it as a solution, because it solved 90% of the problems, but the main topic of this thread was meant to be lack of updates between union and its remotes, which is still not solved - union isn't picking up updates if they are made on the remote itself rather than on the union.

It would be really nice to find out if the only solution is to keep unmounting and remounting union via a cron job?

Have you changed --dir-cache-time 8760h ?

Thank you again, I misunderstood your and Animosity022's replies at first, it seems to work now, but there is one thing that I'm not quite sure of:

--dir-cache-time duration Time to cache directory entries for (default 5m0s)

Are directory entries refer to only "inodes" or file contents as well? That is if you download a 1GB file and set dir-cache-time to 10s does it mean that after 10 seconds that 1GB file will need to be downloaded again?

It means that dir structure (including files) is refreshed every duration time. so new content from remote is picked up.

10s is not good idea as you will be constantly listing both remotes - with Google probably you will hit some quotas. With AWS I am not sure if listing is free... better to check. I normally set it to 15 min for non polling remotes.

There is also possibility to refresh cache on demand using rc I see you have enabled.

You can always run:

rclone rc vfs/refresh recursive=true --rc-user user --rc-pass pass --url 127.0.0.1:8239 _async=true

No - it will only check if this file is still the same on the remote - if yes nothing to do.

1 Like

What you mean renaming does not work?

Perfect, thank you for clarifying. That's good news, but it's still a bit of a shame that polling doesn't work - I've tried refreshing cache on demand using rc, but it didn't work - union directories still stayed the same after a file on one of their remotes was modified until set dir-cache-time passed.

It didn't happen the other way around - if a file was modified in a union changes were reflected almost immediately on its remote (google drive).

It may be a bad idea, but I've set dir-cache-time temporarily to 30 seconds - will monitor billing and see if it makes a difference. Otherwise smaller dir-cache-time intervals may become problematic in a team environment.

Please ignore that, it was referring to long dir-cache-time times before this fixed it.

It isn't.

You'd have better luck doing different remotes and using mergerfs if you want polling. Otherwise, you'd have to implement, sponsor or find someone to implement polling for the union in rclone.

2 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.