SFTP upload to GDrive encrypted mount fails

What is the problem you are having with rclone?

Hi everyone, Google Drive encrypted mount has been working perfectly for months, but since yesterday I am getting the following error message when I upload any file via SFTP directly to the GDrive encrypted mount:

failed to find cache file: object not found
RWFileHandle.Flush error: failed to find cache file: object not found

These are the options I use for the mount (it's mounted via systemd):

--vfs-cache-mode writes --vfs-cache-max-age 5m --write-back-cache --allow-other

EDIT1: The file is seemingly uploaded to the server, but then it disappears from the server and is never uploaded to GDrive.
EDIT2: The mount works fine for reading.

What is your rclone version (output from rclone version)

1.50.0

Which OS you are using and how many bits (eg Windows 7, 64 bit)

Ubuntu 18.04 LTS

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

Google Drive

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

rclone mount \
        --config /home/.../.config/rclone/rclone.conf \
        --vfs-cache-mode writes \
        --vfs-cache-max-age 5m \
        --write-back-cache \
        --allow-other \
        gdrivedsmenc: /...../.....

The rclone config contents with secrets removed.

[gdrivedsm]
type = drive
client_id = 
client_secret = 
scope = drive
token = 
root_folder_id = 

[gdrivedsmenc]
type = crypt
remote = gdrivedsm:
filename_encryption = standard
directory_name_encryption = true
password = 
password2 = 

A log from the command with the -vv flag (this is the log from systemd)

Jul 13 08:41:03  rclone[1315]: 2020/07/13 08:41:03 ERROR : (0xc000b16240): failed to find cache file: object not found
Jul 13 08:41:03  rclone[1315]: 2020/07/13 08:41:03 ERROR : (0xc000b16240): RWFileHandle.Release error: failed to find cache file: object not found
Jul 13 09:02:26  rclone[1315]: 2020/07/13 09:02:26 ERROR : (0xc000d6c300): failed to find cache file: object not found
Jul 13 09:02:26  rclone[1315]: 2020/07/13 09:02:26 ERROR : (0xc000d6c300): RWFileHandle.Flush error: failed to find cache file: object not found
Jul 13 09:02:26  rclone[1315]: 2020/07/13 09:02:26 ERROR : (0xc000d6c300): failed to find cache file: object not found
Jul 13 09:02:26  rclone[1315]: 2020/07/13 09:02:26 ERROR : (0xc000d6c300): RWFileHandle.Release error: failed to find cache file: object not found
Jul 13 11:42:31  rclone[1315]: 2020/07/13 11:42:31 ERROR : (0xc000b16360): failed to find cache file: object not found
Jul 13 11:42:31  rclone[1315]: 2020/07/13 11:42:31 ERROR : (0xc000b16360): RWFileHandle.Flush error: failed to find cache file: object not found
Jul 13 11:42:31  rclone[1315]: 2020/07/13 11:42:31 ERROR : (0xc000b16360): failed to find cache file: object not found
Jul 13 11:42:31  rclone[1315]: 2020/07/13 11:42:31 ERROR : (0xc000b16360): RWFileHandle.Release error: failed to find cache file: object not found
~

hi again,

  • you are using an old version of rclone, can you update to latest stable and test again.
  • are you using a cache backend?

Hi, I am not using any cache remote or other cache thing other than the vfs-cache option on the mount command.

I will try updating rclone and see if it fixes things.

are you downloading via sftp and uploading to gdrive via mount?

I am uploading via SFTP from my home computer to the Ubuntu server. The upload's destination directory is the directory where the GDrive encrypted remote is mounted on that server.

I updated to 1.52.2 and the same problem keeps happening :frowning_face:

for --vfs-cache-max-age, i noticed that you changed default 1h0m0s to 5m

and the error is failed to find cache file

So is it basically getting rid of the file from the vfs cache before it has a chance to upload it to GDrive?
I'm sure it was working fine in the past with the same setting (but of course I could be wrong).

Does the --vfs-cache-max-age counter start counting down from when the file starts being uploaded from my computer to the server, or from when the upload ends?

perhaps this time, there is something different about the file(s) you are trying to upload.
if there was one file we know was causing the problem that would help with testing.

Unfortunately it's the same kind of files (videos) as always, and it keeps happening with multiple ones, not just one.
I can set the --vfs-cache-max-age to 1hr and try, but I am concerned this might clog up my drive space, if e.g. I upload more data in an hour than what can fit on the drive.
Alternatively is there a way to set vfs cache to work only when reading from a remote but not when writing to it? The vfs cache setting helps with playing back the videos but I assume when uploading to a remote mount it can just upload straight to the remote without having to cache the file first.

for a given remote, i run multiple mounts.
each mount optimized to what i want.

one mount for uploading files
one mount for streaming for emby media server, that is read-only
and so on.

that is what i do most often.

not sure that the server is needed to be a middle man to a rclone mount.
just have the home computer upload to the remote, direct or using mount, and bypass the server.

I think when I was setting it all up in the beginning I had some problems pausing/resuming media, and these were fixed when I included the vfs cache option, but I'll try again without it and see how it goes.

Can't use the GDrive remote directly as it is encrypted with rclone so have to use it through the mount.

Just for the sake of completeness,

rclone move

works perfectly fine for moving files from the server to the remote, so must be something to do with the cache, though not sure what's changed.

i mean that you can use rclone to copy files direct to gcrypt, without mount, on the local machine.
rclone copy /path/to/local/folder gcrypt:/folder

1 Like

also,

there are so many ways to this...

1 Like

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