VFS Cache not clearing for webdav mount

What is the problem you are having with rclone?

I have rclone running with nextcloud on a seedbox. Honestly everything is working fine but it seems the cache is a bit bloated. The logs appear to show that these files should be removed but they are not getting removed. I am mostly using defaults and the files below have uploaded to nextcloud and are available for use elsewhere. However, it seems they are still constantly uploading to the remote and I am not sure why. There are no active peers on any of them and haven't been for a while. I am seeding the files, but those should be sparse files at this point which they do not appear to be. Also I do not ever intend for files to change on this mount. I thought about doing a VFS writes but for my situation (seeding) I did not feel that would be best.

Should these files be getting removed from the cache?

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

rclone v1.64.0

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

nextcloud

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

Paste command here

Please run 'rclone config redacted' and share the full output. If you get command not found, please make sure to update rclone.

[Unit]
Description=Rclone Mount Service
After=network.target auditd.service sshd.service

[Service]
Type=simple
ExecStart=/usr/bin/rclone mount \
        --allow-non-empty \
        --config /home/.config/rclone/rclone.conf \
        --log-level DEBUG --log-file "/home/rclone.log" \
        --allow-other \
        --cache-db-purge \
        --vfs-cache-mode full \
        --vfs-read-chunk-size 16M \
        nextcloud:/media /mnt/media/
ExecStop=/bin/fusermount -u /mnt/media
User=hi
Restart=always
RestartSec=10

[Install]
WantedBy=default.target

A log from the command that you were trying to run with the -vv flag

excerpt:

2023/10/26 09:14:16 DEBUG : : >Statfs: stat={Blocks:276424632413 Bfree:274877906944 Bavail:274877906944 Files:1000000000 Ffree:1000000000 Bsize:4096 Namelen:255 Frsize:4096}, err=<nil>
2023/10/26 09:14:24 DEBUG : vfs cache RemoveNotInUse (maxAge=3600000000000, emptyOnly=false): item download//complete/someDir/HomeVideoFile2.2023..1080p.TrueHD.Atmos.7.1.AVC.-FraMeSToR/HomeVideoFile2.2023..1080p.TrueHD.Atmos.7.1.AVC.-FraMeSToR.mkv not removed, freed 0 bytes
2023/10/26 09:14:24 DEBUG : vfs cache RemoveNotInUse (maxAge=3600000000000, emptyOnly=false): item download//complete/someDir/Talk.to.Me.2022.1080p..AVC.TrueHD.Atmos.7.1-playBD/Talk.to.Me.2022.1080p..AVC.TrueHD.Atmos.7.1-playBD.mkv not removed, freed 0 bytes
2023/10/26 09:14:24 DEBUG : vfs cache RemoveNotInUse (maxAge=3600000000000, emptyOnly=false): item download//complete/someDir/The.Cabin.in.the.Woods.2011.Hybrid...1080p.AVC.Atmos.7.1-decibeL.mkv not removed, freed 0 bytes
2023/10/26 09:14:24 DEBUG : vfs cache RemoveNotInUse (maxAge=3600000000000, emptyOnly=false): item download//complete/someDir/The.Exorcist.Believer.2023.2160p.MA.WEB-DL.DDP5.1.Atmos.DV.HDR.H.265-FLUX.mkv not removed, freed 0 bytes
2023/10/26 09:14:24 DEBUG : vfs cache RemoveNotInUse (maxAge=3600000000000, emptyOnly=false): item download//complete/someDir/HomeVideoFile8.2160p...DV.HDR.DTS-HD.MA.5.1.x265-HypStu.mkv not removed, freed 0 bytes
2023/10/26 09:14:24 DEBUG : vfs cache RemoveNotInUse (maxAge=3600000000000, emptyOnly=false): item download//complete/someDir/HomeVideoFile3.Extended...2160p.TrueHD.Atmos.7.1.DV.HEVC.-FraMeSToR/HomeVideoFile3.Extended...2160p.TrueHD.Atmos.7.1.DV.HEVC.-FraMeSToR.mkv not removed, freed 0 bytes
2023/10/26 09:14:24 DEBUG : vfs cache RemoveNotInUse (maxAge=3600000000000, emptyOnly=false): item download//complete/someDir/HomeVideoFile6.MA.WEB-DL.DDP5.1.HDR.HEVC-CMRG.mkv not removed, freed 0 bytes
2023/10/26 09:14:24 DEBUG : vfs cache RemoveNotInUse (maxAge=3600000000000, emptyOnly=false): item download//complete/someDir/HomeVideoFile12023..1080p.TrueHD.Atmos.7.1.AVC.-FraMeSToR/HomeVideoFile12023..1080p.TrueHD.Atmos.7.1.AVC.-FraMeSToR.mkv not removed, freed 0 bytes
2023/10/26 09:14:24 DEBUG : vfs cache RemoveNotInUse (maxAge=3600000000000, emptyOnly=false): item download//complete/someDir/HomeVideoFile7..1080p.DTSHD-MA.h264.-decibeL.mkv not removed, freed 0 bytes
2023/10/26 09:14:24 DEBUG : vfs cache RemoveNotInUse (maxAge=3600000000000, emptyOnly=false): item download//complete/someDir/HomeVideoFile5 1080p AVC Atmos TrueHD7.1-NoGroup.mkv not removed, freed 0 bytes
2023/10/26 09:14:24 DEBUG : vfs cache RemoveNotInUse (maxAge=3600000000000, emptyOnly=false): item download//complete/someDir/HomeVideoFile4.Unrated.Extended.Directors.Cut..1080p.TrueHD.5.1.AVC.-Gohan.mkv not removed, freed 0 bytes
2023/10/26 09:14:24 INFO  : vfs cache: cleaned: objects 11 (was 11) in use 11, to upload 7, uploading 4, total size 333.841Gi (was 333.841Gi)

That does nothing and can be removed.

What is your goal? You want to limit the size to a required set? Time?

--vfs-cache-max-age duration           Max time since last access of objects in the cache (default 1h0m0s)
--vfs-cache-max-size SizeSuffix        Max total size of objects in the cache (default off)

I am trying not to set a cache size limit (just leave it default) and I want the cache max age (the default) to be respected more than I care about the size limit. So if nothing has touched one of those files in the last hour, which is the case, just have them get purged from the cache.

It is also unclear to me why they are being uploaded again.

That's how it is working from your log.

You have 11 things being uploaded so it can't remove them until the uploads happens regardless of any time you set as if the time expired and it wans't uploaded, you would lose data.

That's part of the problem. The files have uploaded and are fully available elsewhere. Some have been in there for over 1 week. I've had other files come and go. I will have to look at checksumming. What if I just manually removed these files?

image

Based on the logs, you have new files being uploaded. You'd have show something that shows the issue as that's not how the cache stuff works.

I'd highly advise against that as you risk data loss, cache corruption and things generally not working. The cache area isn't supposed to be interacted with outside of rclone. You'd do that at your own risk.

Based on the logs, you have new files being uploaded. You'd have show something that shows the issue as that's not how the cache stuff works.

I ran an MD5 sum on the cache file and from the server (not using rclone at all). The checksum for both files came back the same. Does that not show that the file has been successfully uploaded and the fact that it is still trying to upload the file is not correct?

In the snippet of logs below I also see the rclone compare which seems to have the same result yet it still uploads the file. I also see there is another error happening with a 524 timeout. I don't know why and then it loops. Again all of these files have matching checksums so I feel we are in some kind of error loop.

2e7e6b002823947c2202121e99955658  file1.mkv
2e7e6b002823947c2202121e99955658  file1.mkv
2023/10/26 09:10:21 DEBUG : download//complete//file1/file1.mkv: vfs cache: checking remote fingerprint "20760287109,2023-10-18 17:22:06 +0000 UTC,6e63facc996fb7093e5ede9f11d09bbf41d407e2" against cached fingerprint "20760287109,2023-10-18 17:22:06 +0000 UTC,6e63facc996fb7093e5ede9f11d09bbf41d407e2"
2023/10/26 09:10:21 DEBUG : download//complete//file1/file1.mkv: vfs cache: truncate to size=20760287109 (not needed as size correct)
2023/10/26 09:10:21 DEBUG : vfs cache: looking for range={Pos:0 Size:20760287109} in [{Pos:0 Size:20760287109}] - present true
2023/10/26 09:10:21 DEBUG : download//complete//file1/file1.mkv: vfs cache: setting modification time to 2023-10-18 12:22:06.252834528 -0500 CDT
2023/10/26 09:10:21 INFO  : download//complete//file1/file1.mkv: vfs cache: queuing for upload in 5s
2023/10/26 09:10:21 DEBUG : download//complete//file1: Added virtual directory entry vAddFile: "file1.mkv"

2023/10/26 10:13:33 ERROR : download//complete//another file.mkv: Failed to copy: finalize chunked upload failed, destinationURL: "another file.mkv": 524 

2023/10/26 12:06:59 DEBUG : download//complete//file1/file1.mkv: vfs cache: starting upload
2023/10/26 12:07:00 DEBUG : download//complete//file1/file1.mkv: Update will use the chunked upload strategy

2023/10/26 12:29:24 DEBUG : vfs cache RemoveNotInUse (maxAge=3600000000000, emptyOnly=false): item download//complete//file1/file1.mkv not removed, freed 0 bytes

From that log, the file never uploads and fails. I'd imagine your larger mount log, you'd see those ERRORs repeating, which is why the cache isn't clearing?

Perhaps try to upload without the mount for a file and see if that works? I don't use WebDav at all.

It looks like my issue is related to this bug 7109. I use cloudflare which was proxying the requests, I have bypassed that and the 423 shows up. I will look into the suggestions in the bug and post back.

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