What is the problem you are having with rclone?
We have a custom webdav backend that we're mounting with rclone, because rclone has awesome caching features that we don't have to implement ourselves, yay! We found at first that rclone was using only the file size as part of the cache fingerprint, which we resolved by upgrading to 1.65.1 and setting --webdav-vendor
to rclone
. This was enough to get the fingerprint to include both the file size and the last-modified header from the GET request (for the cached content).
However, I am finding that if I do the following steps, I get a stale cache entry but with updated contents' key:
- Mount the external webdav source with cache set to full mode
- View the file, e.g. cat /mnt/webdav/subdir/hello.txt
- Edit the file in the external webdav source and make a trivial change to it
- Run
ls /mnt/webdav/subdir/hello.txt && cat /mnt/webdav/subdir/hello.txt
80% of the time the file is the old version, but some of the time I will get back the correct file. In the logs I can see rclone reporting that the cache fingerprint is empty (for the file I fetched) whereas it was definitely set the first time I fetched the file:
2024/01/13 13:58:12 DEBUG : projects/tta/default/monster-analysis/project.ini: vfs cache: checking remote fingerprint "1714,2024-01-13 00:58:09 +0000 UTC" against cached fingerprint ""
Run the command 'rclone version' and share the full output of the command.
$ rclone --version
rclone v1.65.1
- os/version: ubuntu 20.04 (64 bit)
- os/kernel: 5.15.0-91-generic (x86_64)
- os/type: linux
- os/arch: amd64
- go/version: go1.21.5
- go/linking: static
- go/tags: none
Which cloud storage system are you using? (eg Google Drive)
A custom webdav implementation
The command you were trying to run (eg rclone copy /tmp remote:tmp
)
rclone -vvv mount --webdav-vendor=rclone --read-only --cache-tmp-upload-path=/tmp --cache-chunk-path=/tmp --cache-workers=8 --cache-writes --cache-dir=/tmp --cache-db-path=/tmp --vfs-cache-mode=full --stats=0 --checkers=16 --bwlimit=40M --transfers=1 --dir-cache-time=1s --cache-info-age=1s webdav-local: /home/nickg/mnt/
The rclone config contents with secrets removed.
[webdav-local]
type = webdav
url = http://localhost:8080/dav
user = REDACTED
pass = REDACTED
A log from the command with the -vv
flag
Log showing start up and initial fetch:
2024/01/13 14:30:13 INFO : Starting bandwidth limiter at 40Mi Byte/s
2024/01/13 14:30:13 DEBUG : rclone: Version "v1.65.1" starting with parameters ["rclone" "-vvv" "mount" "--webdav-vendor=rclone" "--read-only" "--cache-tmp-upload-path=/tmp" "--cache-chunk-path=/tmp" "--cache-workers=8" "--cache-writes" "--cache-dir=/tmp" "--cache-db-path=/tmp" "--vfs-cache-mode=full" "--stats=0" "--checkers=16" "--bwlimit=40M" "--transfers=1" "--dir-cache-time=1s" "--cache-info-age=1s" "webdav-local:" "/home/nickg/mnt/"]
2024/01/13 14:30:13 DEBUG : Creating backend with remote "webdav-local:"
2024/01/13 14:30:13 DEBUG : Using config file from "/home/nickg/.config/rclone/rclone.conf"
2024/01/13 14:30:13 DEBUG : webdav-local: detected overridden config - adding "{Q1VxD}" suffix to name
2024/01/13 14:30:13 DEBUG : found headers:
2024/01/13 14:30:13 DEBUG : fs cache: renaming cache item "webdav-local:" to be canonical "webdav-local{Q1VxD}:"
2024/01/13 14:30:13 INFO : webdav root '': poll-interval is not supported by this remote
2024/01/13 14:30:13 DEBUG : vfs cache: root is "/tmp"
2024/01/13 14:30:13 DEBUG : vfs cache: data root is "/tmp/vfs/webdav-local{Q1VxD}"
2024/01/13 14:30:13 DEBUG : vfs cache: metadata root is "/tmp/vfsMeta/webdav-local{Q1VxD}"
2024/01/13 14:30:13 DEBUG : Creating backend with remote "/tmp/vfs/webdav-local{Q1VxD}/"
2024/01/13 14:30:13 DEBUG : fs cache: renaming cache item "/tmp/vfs/webdav-local{Q1VxD}/" to be canonical "/tmp/vfs/webdav-local{Q1VxD}"
2024/01/13 14:30:13 DEBUG : Creating backend with remote "/tmp/vfsMeta/webdav-local{Q1VxD}/"
2024/01/13 14:30:13 DEBUG : fs cache: renaming cache item "/tmp/vfsMeta/webdav-local{Q1VxD}/" to be canonical "/tmp/vfsMeta/webdav-local{Q1VxD}"
2024/01/13 14:30:13 INFO : vfs cache: cleaned: objects 0 (was 0) in use 0, to upload 0, uploading 0, total size 0 (was 0)
2024/01/13 14:30:13 DEBUG : webdav root '': Mounting on "/home/nickg/mnt/"
2024/01/13 14:30:13 DEBUG : : Root:
2024/01/13 14:30:13 DEBUG : : >Root: node=/, err=<nil>
2024/01/13 14:30:13 DEBUG : /: Lookup: name=".Trash"
2024/01/13 14:30:13 ERROR : Failed to parse time "Thu, 1 Jan 1970 12:00:00 +1200" - using the epoch
2024/01/13 14:30:13 DEBUG : /: >Lookup: node=<nil>, err=no such file or directory
2024/01/13 14:30:13 DEBUG : /: Attr:
2024/01/13 14:30:13 DEBUG : /: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=<nil>
2024/01/13 14:30:13 DEBUG : /: Lookup: name=".xdg-volume-info"
2024/01/13 14:30:13 DEBUG : /: Lookup: name="autorun.inf"
2024/01/13 14:30:13 DEBUG : /: >Lookup: node=<nil>, err=no such file or directory
2024/01/13 14:30:13 DEBUG : /: >Lookup: node=<nil>, err=no such file or directory
2024/01/13 14:30:13 DEBUG : /: Lookup: name=".Trash-10283"
2024/01/13 14:30:13 DEBUG : /: >Lookup: node=<nil>, err=no such file or directory
2024/01/13 14:30:13 DEBUG : /: ReadDirAll:
2024/01/13 14:30:13 DEBUG : /: >ReadDirAll: item=4, err=<nil>
2024/01/13 14:30:13 DEBUG : /: ReadDirAll:
2024/01/13 14:30:13 DEBUG : /: >ReadDirAll: item=4, err=<nil>
2024/01/13 14:30:13 DEBUG : /: ReadDirAll:
2024/01/13 14:30:13 DEBUG : /: >ReadDirAll: item=4, err=<nil>
2024/01/13 14:30:13 DEBUG : /: ReadDirAll:
2024/01/13 14:30:13 DEBUG : /: >ReadDirAll: item=4, err=<nil>
2024/01/13 14:30:13 DEBUG : /: ReadDirAll:
2024/01/13 14:30:13 DEBUG : /: >ReadDirAll: item=4, err=<nil>
2024/01/13 14:30:13 DEBUG : /: ReadDirAll:
2024/01/13 14:30:13 DEBUG : /: >ReadDirAll: item=4, err=<nil>
2024/01/13 14:30:13 DEBUG : /: ReadDirAll:
2024/01/13 14:30:13 DEBUG : /: >ReadDirAll: item=4, err=<nil>
2024/01/13 14:30:13 DEBUG : /: ReadDirAll:
2024/01/13 14:30:13 DEBUG : /: >ReadDirAll: item=4, err=<nil>
2024/01/13 14:30:13 DEBUG : /: ReadDirAll:
2024/01/13 14:30:13 DEBUG : /: >ReadDirAll: item=4, err=<nil>
2024/01/13 14:30:13 DEBUG : /: ReadDirAll:
2024/01/13 14:30:13 DEBUG : /: >ReadDirAll: item=4, err=<nil>
2024/01/13 14:30:13 DEBUG : /: ReadDirAll:
2024/01/13 14:30:13 DEBUG : /: >ReadDirAll: item=4, err=<nil>
2024/01/13 14:30:13 DEBUG : /: ReadDirAll:
2024/01/13 14:30:13 DEBUG : /: >ReadDirAll: item=4, err=<nil>
2024/01/13 14:30:13 DEBUG : /: ReadDirAll:
2024/01/13 14:30:13 DEBUG : /: >ReadDirAll: item=4, err=<nil>
2024/01/13 14:30:13 DEBUG : /: ReadDirAll:
2024/01/13 14:30:13 DEBUG : /: >ReadDirAll: item=4, err=<nil>
2024/01/13 14:30:13 DEBUG : /: ReadDirAll:
2024/01/13 14:30:13 DEBUG : /: >ReadDirAll: item=4, err=<nil>
2024/01/13 14:30:13 DEBUG : /: ReadDirAll:
2024/01/13 14:30:13 DEBUG : /: >ReadDirAll: item=4, err=<nil>
2024/01/13 14:30:13 DEBUG : /: ReadDirAll:
2024/01/13 14:30:13 DEBUG : /: >ReadDirAll: item=4, err=<nil>
2024/01/13 14:30:13 DEBUG : /: ReadDirAll:
2024/01/13 14:30:13 DEBUG : /: >ReadDirAll: item=4, err=<nil>
2024/01/13 14:30:13 DEBUG : /: ReadDirAll:
2024/01/13 14:30:13 DEBUG : /: >ReadDirAll: item=4, err=<nil>
2024/01/13 14:30:13 DEBUG : /: ReadDirAll:
2024/01/13 14:30:13 DEBUG : /: >ReadDirAll: item=4, err=<nil>
2024/01/13 14:30:13 DEBUG : /: ReadDirAll:
2024/01/13 14:30:13 DEBUG : /: >ReadDirAll: item=4, err=<nil>
2024/01/13 14:30:13 DEBUG : /: ReadDirAll:
2024/01/13 14:30:13 DEBUG : /: >ReadDirAll: item=4, err=<nil>
2024/01/13 14:30:13 DEBUG : /: ReadDirAll:
2024/01/13 14:30:13 DEBUG : /: >ReadDirAll: item=4, err=<nil>
2024/01/13 14:30:13 DEBUG : /: ReadDirAll:
2024/01/13 14:30:13 DEBUG : /: >ReadDirAll: item=4, err=<nil>
2024/01/13 14:30:13 DEBUG : /: ReadDirAll:
2024/01/13 14:30:13 DEBUG : /: >ReadDirAll: item=4, err=<nil>
2024/01/13 14:30:13 DEBUG : /: ReadDirAll:
2024/01/13 14:30:13 DEBUG : /: >ReadDirAll: item=4, err=<nil>
2024/01/13 14:30:13 DEBUG : /: Lookup: name="autorun.inf"
2024/01/13 14:30:13 DEBUG : /: >Lookup: node=<nil>, err=no such file or directory
2024/01/13 14:30:13 DEBUG : : Statfs:
2024/01/13 14:30:14 DEBUG : : >Statfs: stat={Blocks:274877906944 Bfree:274877906944 Bavail:274877906944 Files:1000000000 Ffree:1000000000 Bsize:4096 Namelen:255 Frsize:4096}, err=<nil>
2024/01/13 14:30:15 DEBUG : : forgetting directory cache
2024/01/13 14:30:15 DEBUG : users: forgetting directory cache
2024/01/13 14:30:15 DEBUG : projects: forgetting directory cache
2024/01/13 14:30:15 DEBUG : users: forgetting directory cache
2024/01/13 14:30:15 DEBUG : projects: forgetting directory cache
2024/01/13 14:30:18 DEBUG : /: Lookup: name="projects"
2024/01/13 14:30:18 DEBUG : /: >Lookup: node=projects/, err=<nil>
2024/01/13 14:30:18 DEBUG : projects/: Attr:
2024/01/13 14:30:18 DEBUG : projects/: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=<nil>
2024/01/13 14:30:18 DEBUG : projects/: Lookup: name="tta"
2024/01/13 14:30:18 DEBUG : projects/: >Lookup: node=projects/tta/, err=<nil>
2024/01/13 14:30:18 DEBUG : projects/tta/: Attr:
2024/01/13 14:30:18 DEBUG : projects/tta/: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=<nil>
2024/01/13 14:30:18 DEBUG : projects/tta/: Lookup: name="default"
2024/01/13 14:30:18 DEBUG : projects/tta/: >Lookup: node=projects/tta/default/, err=<nil>
2024/01/13 14:30:18 DEBUG : projects/tta/default/: Attr:
2024/01/13 14:30:18 DEBUG : projects/tta/default/: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=<nil>
2024/01/13 14:30:18 DEBUG : projects/tta/default/: Lookup: name="monster-analysis"
2024/01/13 14:30:18 DEBUG : projects/tta/default/: >Lookup: node=projects/tta/default/monster-analysis/, err=<nil>
2024/01/13 14:30:18 DEBUG : projects/tta/default/monster-analysis/: Attr:
2024/01/13 14:30:18 DEBUG : projects/tta/default/monster-analysis/: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=<nil>
2024/01/13 14:30:18 DEBUG : projects/tta/default/monster-analysis/: Lookup: name="project.ini"
2024/01/13 14:30:18 DEBUG : projects/tta/default/monster-analysis/: >Lookup: node=projects/tta/default/monster-analysis/project.ini, err=<nil>
2024/01/13 14:30:18 DEBUG : projects/tta/default/monster-analysis/project.ini: Attr:
2024/01/13 14:30:18 DEBUG : projects/tta/default/monster-analysis/project.ini: >Attr: a=valid=1s ino=0 size=1717 mode=-rw-rw-r--, err=<nil>
2024/01/13 14:30:18 DEBUG : projects/tta/default/monster-analysis/project.ini: Open: flags=OpenReadOnly
2024/01/13 14:30:18 DEBUG : projects/tta/default/monster-analysis/project.ini: Open: flags=O_RDONLY
2024/01/13 14:30:18 DEBUG : projects/tta/default/monster-analysis/project.ini: newRWFileHandle:
2024/01/13 14:30:18 DEBUG : projects/tta/default/monster-analysis/project.ini: >newRWFileHandle: err=<nil>
2024/01/13 14:30:18 DEBUG : projects/tta/default/monster-analysis/project.ini: >Open: fd=projects/tta/default/monster-analysis/project.ini (rw), err=<nil>
2024/01/13 14:30:18 DEBUG : projects/tta/default/monster-analysis/project.ini: >Open: fh=&{projects/tta/default/monster-analysis/project.ini (rw)}, err=<nil>
2024/01/13 14:30:18 DEBUG : &{projects/tta/default/monster-analysis/project.ini (rw)}: Read: len=4096, offset=0
2024/01/13 14:30:18 DEBUG : projects/tta/default/monster-analysis/project.ini(0xc00074f880): _readAt: size=4096, off=0
2024/01/13 14:30:18 DEBUG : projects/tta/default/monster-analysis/project.ini(0xc00074f880): openPending:
2024/01/13 14:30:18 DEBUG : projects/tta/default/monster-analysis/project.ini: vfs cache: checking remote fingerprint "1717,2024-01-13 01:18:08 +0000 UTC" against cached fingerprint ""
2024/01/13 14:30:18 DEBUG : projects/tta/default/monster-analysis/project.ini: vfs cache: truncate to size=1717
2024/01/13 14:30:18 DEBUG : projects/tta/default/monster-analysis: Added virtual directory entry vAddFile: "project.ini"
2024/01/13 14:30:18 DEBUG : projects/tta/default/monster-analysis/project.ini(0xc00074f880): >openPending: err=<nil>
2024/01/13 14:30:18 DEBUG : vfs cache: looking for range={Pos:0 Size:1717} in [] - present false
2024/01/13 14:30:18 DEBUG : projects/tta/default/monster-analysis/project.ini: ChunkedReader.RangeSeek from -1 to 0 length -1
2024/01/13 14:30:18 DEBUG : projects/tta/default/monster-analysis/project.ini: ChunkedReader.Read at -1 length 32768 chunkOffset 0 chunkSize 134217728
2024/01/13 14:30:18 DEBUG : projects/tta/default/monster-analysis/project.ini: ChunkedReader.openRange at 0 length 134217728
2024/01/13 14:30:18 DEBUG : projects/tta/default/monster-analysis/project.ini(0xc00074f880): >_readAt: n=1717, err=EOF
2024/01/13 14:30:18 DEBUG : &{projects/tta/default/monster-analysis/project.ini (rw)}: >Read: read=1717, err=<nil>
2024/01/13 14:30:18 DEBUG : &{projects/tta/default/monster-analysis/project.ini (rw)}: Flush:
2024/01/13 14:30:18 DEBUG : projects/tta/default/monster-analysis/project.ini(0xc00074f880): RWFileHandle.Flush
2024/01/13 14:30:18 DEBUG : &{projects/tta/default/monster-analysis/project.ini (rw)}: >Flush: err=<nil>
2024/01/13 14:30:18 DEBUG : &{projects/tta/default/monster-analysis/project.ini (rw)}: Release:
2024/01/13 14:30:18 DEBUG : projects/tta/default/monster-analysis/project.ini(0xc00074f880): RWFileHandle.Release
2024/01/13 14:30:18 DEBUG : projects/tta/default/monster-analysis/project.ini(0xc00074f880): close:
2024/01/13 14:30:18 DEBUG : projects/tta/default/monster-analysis/project.ini: vfs cache: setting modification time to 2024-01-13 14:18:08 +1300 NZDT
2024/01/13 14:30:18 DEBUG : projects/tta/default/monster-analysis/project.ini(0xc00074f880): >close: err=<nil>
2024/01/13 14:30:18 DEBUG : &{projects/tta/default/monster-analysis/project.ini (rw)}: >Release: err=<nil>
2024/01/13 14:30:20 DEBUG : users: forgetting directory cache
2024/01/13 14:30:20 DEBUG : : forgetting directory cache
2024/01/13 14:30:20 DEBUG : projects: forgetting directory cache
2024/01/13 14:30:20 DEBUG : projects/tta: forgetting directory cache
2024/01/13 14:30:20 DEBUG : projects/tta/default: forgetting directory cache
2024/01/13 14:30:20 DEBUG : projects/tta/default/monster-analysis: forgetting directory cache
2024/01/13 14:30:20 DEBUG : projects/tta/default/monster-analysis: Removed virtual directory entry vAddFile: "project.ini"
2024/01/13 14:30:20 DEBUG : projects/fenz: forgetting directory cache
2024/01/13 14:30:20 DEBUG : projects/gns: forgetting directory cache
2024/01/13 14:30:20 DEBUG : projects/niwa: forgetting directory cache
2024/01/13 14:30:20 DEBUG : users: forgetting directory cache
Then I did the "change file then ls && cat" steps from earlier. First one succeeded, second one failed. I can see in the logs that it says the cache fingerprint has disappeared (`checking remote fingerprint "1718,2024-01-13 01:34:34 +0000 UTC" against cached fingerprint ""``.
If it succeeds, I can see that the checking remote fingerprint log shows a correct cached fingerprint. Note that if I leave out the ls
it works fine as long as I do the GET straight after the file change (maybe before the cache checker runs?).
Is this a bug? Have I misconfigured something? Is our webdav implementation missing some crucial header in the PROPFIND response?