Rclone serve docker: directory listing outdated

What is the problem you are having with rclone?

I am using the rclone Docker Volume Plugin to provide an rclone remote to a Docker container like this:

docker run --mount 'target=/ms,volume-driver=rclone,volume-opt=remote=ms:'

The remote is a very simple b2-backed crypt remote:

[backing-remote]
type = b2
account = [REDACTED]
key = [REDACTED]
hard_delete = true

[ms]
type = crypt
remote = backing-remote:[REDACTED]/rclone-crypt
password = [REDACTED]

I have the same config on another machine.

If I run ls /ms in the Docker container, then delete a file on the remote from the other machine and then run ls /ms again, the file is still shown. I'm suspecting the directory listing is somehow cached but I cannot find any related config options. The file will eventually go away but it takes a long time (almost a minute). If I list the remote with rclone ls ms: the file is already gone but in the container it still appears in the virtual file system.

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

rclone v1.62.2
- os/version: ubuntu 22.04 (64 bit)
- os/kernel: 5.15.0-69-generic (x86_64)
- os/type: linux
- os/arch: amd64
- go/version: go1.20.2
- go/linking: static
- go/tags: none

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

B2

A log from the command with the -vv flag

I don't know how to get the logs of the volume plugin, docker ps doesn't show the special container and docker plugin doesn't have a subcommand for logs.

It is described here. It was staring me right in the face while I was reading the " VFS File Caching" section.

--mount 'target=/ms,volume-driver=rclone,volume-opt=remote=ms:,volume-opt=dir-cache-time=0,volume-opt=poll-interval=0'

ls no longer returns instantly and the files are now up to date.

1 Like

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