Vfs/forget and vfs/refresh do not work on webdav mount

What is the problem you are having with rclone?

After updating a remote via a move command outside of the mount, files are verified to be present remotely but do not appear on the mount when using dir-cache-time 6h. Files are not present even after running vfs/forget on the file and vfs/refresh recursive=true on the path.

The files are moved using a script but basically:

1/ Move command is run: /usr/bin/rclone move /mnt/md0/Media offsite_wrapped:Media --files-from=/home/xxx/offsite-longterm.txt --sftp-disable-hashcheck --no-update-dir-modtime --no-update-modtime -vv --low-level-retries 0

This move command uses an sftp remote to maintain modified timestamps.

2/ The mount is refreshed and the file is re-cached on this mount's cache by running a file command on it

rclone --rc-addr 127.0.0.1:5574 rc vfs/forget file="Media/$path" -v --syslog
rclone --rc-addr 127.0.0.1:5574 rc vfs/refresh dir="Media/$MAINPATH" recursive=true -v --syslog
sleep 5
file "/home/xxx/test/Media/$path"

More often than not, that last file command will return: "No such file or directory". It does not happen every time, but happens often enough to cause issues.

Even running a full rclone --rc-addr 127.0.0.1:5574 rc vfs/forget does not work when this happens, the only way to see the files is to send rclone the SIGHUP signal.

Sample run:

2024/07/12 10:38:29 DEBUG : sftp://xxx@10.8.0.2:22//srv/mergerfs/union/Media: Not closing 0 unused connections as 1 sessions active
2024/07/12 10:38:38 DEBUG : TV/TV_Local/Caught Up (2023)/Season 01/Caught Up (2023) - S01E04 - Complicated [WEBDL-1080p][EAC3 2.0][h264]-DiMEPiECE.mkv.xopenor4.partial: renamed to: TV/TV_Local/Caught Up (2023)/Season 01/Caught Up (2023) - S01E04 - Complicated [WEBDL-1080p][EAC3 2.0][h264]-DiMEPiECE.mkv
2024/07/12 10:38:38 INFO  : TV/TV_Local/Caught Up (2023)/Season 01/Caught Up (2023) - S01E04 - Complicated [WEBDL-1080p][EAC3 2.0][h264]-DiMEPiECE.mkv: Copied (new)
2024/07/12 10:38:38 INFO  : TV/TV_Local/Caught Up (2023)/Season 01/Caught Up (2023) - S01E04 - Complicated [WEBDL-1080p][EAC3 2.0][h264]-DiMEPiECE.mkv: Deleted
2024/07/12 10:38:38 INFO  :
Transferred:      670.277 MiB / 670.277 MiB, 100%, 9.745 MiB/s, ETA 0s
Checks:                 1 / 1, 100%
Deleted:                1 (files), 0 (dirs), 670.277 MiB (freed)
Renamed:                1
Transferred:            1 / 1, 100%
Elapsed time:      1m15.0s

2024/07/12 10:38:38 DEBUG : 15 go routines active
2024/07/12 10:38:38 DEBUG : sftp://xxx@10.8.0.2:22//srv/mergerfs/union/Media: Closing 1 unused connections
{
        "forgotten": [
                "Media/TV/TV_Local/Caught Up (2023)/Season 01/Caught Up (2023) - S01E04 - Complicated [WEBDL-1080p][EAC3 2.0][h264]-DiMEPiECE.mkv"
        ]
}
{
        "result": {
                "Media/TV/TV_Local/Caught Up (2023)": "file does not exist"
        }
}

/mnt/remote/offsite_dav/Media/TV/TV_Local/Caught Up (2023)/Season 01/Caught Up (2023) - S01E04 - Complicated [WEBDL-1080p][EAC3 2.0][h264]-DiMEPiECE.mkv: cannot open `/mnt/remote/offsite_dav/Media/TV/TV_Local/Caught Up (2023)/Season 01/Caught Up (2023) - S01E04 - Complicated [WEBDL-1080p][EAC3 2.0][h264]-DiMEPiECE.mkv' (No such file or directory)

File exists remotely:

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

rclone v1.67.0

  • os/version: ubuntu 22.04 (64 bit)
  • os/kernel: 6.5.0-35-generic (x86_64)
  • os/type: linux
  • os/arch: amd64
  • go/version: go1.22.4
  • go/linking: static
  • go/tags: none

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

Webdav served by rclone serve webdav

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

/usr/bin/rclone mount --allow-other --cache-dir=/home/xxx/.cache1 --config=/home/xxx/.config/rclone/rclone.conf --copy-links --dir-cache-time=6h --buffer-size 32M --rc --rc-addr=localhost:5574 --rc-no-auth --umask=002 --user-agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.131 Safari/537.36" --vfs-cache-min-free-space=off --vfs-cache-max-age=504h --vfs-cache-max-size=400G --vfs-cache-mode=full --vfs-fast-fingerprint --vfs-read-ahead=128M --poll-interval 0 --vfs-read-chunk-size-limit=128M --vfs-read-chunk-size=32M -vvvv offsite_dav: ~/test

The rclone config contents with secrets removed.

[offsite_dav]
type = webdav
url = http://10.8.0.2:8081
user = xxxxx
pass = xxxxxxxx
vendor = rclone

A log from the command with the -vv flag

024/07/12 10:37:30 DEBUG : : Statfs:
2024/07/12 10:37:30 DEBUG : : >Statfs: stat={Blocks:274877906944 Bfree:274877906944 Bavail:274877906944 Files:1000000000 Ffree:1000000000 Bsize:4096 Namelen:255 Frsize:4096}, err=<nil>
2024/07/12 10:37:40 DEBUG : : Statfs:
2024/07/12 10:37:40 DEBUG : : >Statfs: stat={Blocks:274877906944 Bfree:274877906944 Bavail:274877906944 Files:1000000000 Ffree:1000000000 Bsize:4096 Namelen:255 Frsize:4096}, err=<nil>
2024/07/12 10:37:50 DEBUG : : Statfs:
2024/07/12 10:37:50 DEBUG : : >Statfs: stat={Blocks:274877906944 Bfree:274877906944 Bavail:274877906944 Files:1000000000 Ffree:1000000000 Bsize:4096 Namelen:255 Frsize:4096}, err=<nil>
2024/07/12 10:38:00 DEBUG : : Statfs:
2024/07/12 10:38:00 DEBUG : : >Statfs: stat={Blocks:274877906944 Bfree:274877906944 Bavail:274877906944 Files:1000000000 Ffree:1000000000 Bsize:4096 Namelen:255 Frsize:4096}, err=<nil>
2024/07/12 10:38:08 INFO  : vfs cache: cleaned: objects 0 (was 0) in use 0, to upload 0, uploading 0, total size 0 (was 0)
2024/07/12 10:38:10 DEBUG : : Statfs:
2024/07/12 10:38:10 DEBUG : : >Statfs: stat={Blocks:274877906944 Bfree:274877906944 Bavail:274877906944 Files:1000000000 Ffree:1000000000 Bsize:4096 Namelen:255 Frsize:4096}, err=<nil>
2024/07/12 10:38:20 DEBUG : : Statfs:
2024/07/12 10:38:20 DEBUG : : >Statfs: stat={Blocks:274877906944 Bfree:274877906944 Bavail:274877906944 Files:1000000000 Ffree:1000000000 Bsize:4096 Namelen:255 Frsize:4096}, err=<nil>
2024/07/12 10:38:30 DEBUG : : Statfs:
2024/07/12 10:38:30 DEBUG : : >Statfs: stat={Blocks:274877906944 Bfree:274877906944 Bavail:274877906944 Files:1000000000 Ffree:1000000000 Bsize:4096 Namelen:255 Frsize:4096}, err=<nil>
2024/07/12 10:38:38 DEBUG : rc: "vfs/forget": with parameters map[file:Media/TV/TV_Local/Caught Up (2023)/Season 01/Caught Up (2023) - S01E04 - Complicated [WEBDL-1080p][EAC3 2.0][h264]-DiMEPiECE.mkv]
2024/07/12 10:38:38 DEBUG : : ForgetPath: relativePath="Media/TV/TV_Local/Caught Up (2023)/Season 01/Caught Up (2023) - S01E04 - Complicated [WEBDL-1080p][EAC3 2.0][h264]-DiMEPiECE.mkv", type=1
2024/07/12 10:38:38 DEBUG : : >ForgetPath:
2024/07/12 10:38:38 DEBUG : rc: "vfs/forget": reply map[forgotten:[Media/TV/TV_Local/Caught Up (2023)/Season 01/Caught Up (2023) - S01E04 - Complicated [WEBDL-1080p][EAC3 2.0][h264]-DiMEPiECE.mkv]]: <nil>
2024/07/12 10:38:38 DEBUG : rc: "vfs/refresh": with parameters map[dir:Media/TV/TV_Local/Caught Up (2023) recursive:true]
2024/07/12 10:38:38 DEBUG : rc: "vfs/refresh": reply map[result:map[Media/TV/TV_Local/Caught Up (2023):file does not exist]]: <nil>

The file was properly uploaded and can be seen both locally:

root@openmediavault:~# ls "/srv/mergerfs/union/Media/TV/TV_Local/Caught Up (2023)/Season 01/"
'Caught Up (2023) - S01E04 - Complicated [WEBDL-1080p][EAC3 2.0][h264]-DiMEPiECE.mkv'

and via rclone:

$ rclone ls "offsite_dav:Media/TV/TV_Local/Caught Up (2023)/Season 01/"
702835977 Caught Up (2023) - S01E04 - Complicated [WEBDL-1080p][EAC3 2.0][h264]-DiMEPiECE.mkv

But mount does not work.

Upon further analysis I realized that rclone ls offsite_dav:Media showed different results from rclone ls offsite_wrapped:Media right after upload. This led me to realizing that dir-cache-time was set at the default of 5m on the rclone serve mount. After changing that to dir-cache-time 0 I can no longer reproduce this.

EDIT: I lied, that didn't work. I've been able to trace this to new paths being created on the remote. So when "/Media/TV/TV_Local/Path A" exists and files are moved there, it works, when the script moves on to "/Media/TV/TV_Local/Path B" (which is new on the remote), it fails.

I think it has to do with the vfs/forget and refresh not happening deep enough (so when it moves to Path B, that path doesn't exist and vfs/refresh doesn't do anything. I probably need to refresh "/Media/TV/TV_Local" non-recursively, instead of "/Media/TV/TV_Local/Whatever" recursively so the new path gets picked up?

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