You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running the below command and downloading an arbitrary file from chromium (in my case - a pdf from google drive) directly into a mounted rclone remote, the file appears successfully downloaded in the directory, and is accessible by file managers and reader programs. However after remounting the rclone mount, the file disappears, as rclone actually silently failed uploading it. This is very dangerous for users who do not constantly monitor rclone mount's terminal output, where we can see the following transmission errors: https://termbin.com/g2o30
Even after enabling the options --retries 99 --retries-sleep 10s, which should force rclone to retry the same process after a delay, the upload still fails once it is initiated and is not retried. This can lead to involuntary data loss as was for my case.
I haven't tried, but I suspect that using cache as a wrapper backend could work as a temporary workaround. I presume that rclone gets confused due to chrome's way of downloading files and then renaming them to the target name.
What is your rclone version (output from rclone version)
rclone v1.51.0
os/arch: linux/amd64
go version: go1.14.2
Which cloud storage system are you using? (eg Google Drive)
Onedrive for Business, without extra chained remotes sych as crypt, chunker, or cache.
The command you were trying to run (eg rclone copy /tmp remote:tmp)
rclone -vv --retries 99 --retries-sleep 10s --vfs-cache-mode full mount remote: ~/somedir
A log from the command with the -vv flag (eg output from rclone -vv copy /tmp remote:tmp)
I've emailed it to @ncw as it may contain sensitive information.
The only way I understand that it fails is by seeing the log output of the mount process (https://termbin.com/g2o30). Chrome does not give out any errors and the file is perfectly readable and accessible in the mount directory, until it is remounted and disappears as it was never uploaded in the first place. What I tried to explain may not be "silent corruption". However it is still quite dangerous as the user does something very normal (download a file from the internet), the mount behaves as if the operation as successful (lists the file in the directory, allows the user to successfully read it), and eventually it turns out that the operation was unsuccessful. I don't know if/how Chrome handles IO errors when downloading files. However I suspect that there were no IO write errors given as the file wouldn't be placed in the mount in the first place.
The observed behaviour really seems identical to #2382. However in the latter's description it is stated that this happens when "the VFS cache will begin deleting any non uploaded files when they reach their retries amount." What I observe here is that the operation is cancelled even before reaching the stated retries amount and the delay between retries. It may still be the same issue triggered by a different stimulus however.
I think think that rclone gets confused when chrome first creates an empty file, this empty file is uploaded to the backend, rclone comes back to check if the sizes are the same and by that time chrome has already filled up that local file with content, hence the uploaded file is rejected.
What is weird here is why rclone does not retry the same upload operation as given by the flags --retries 99 --retries-sleep 10s
That is onedrive complaining that you are about to rename a file on top of an existing file.
Renaming a file on top of another file isn't part of the integration tests which means that rclone backends are differ in their implementations. The local backend will overwrite an existing file whereas the onedrive backend throws an error.
If the onedrive backend had allowed the rename in this case then it would have worked.
This would also have been fixed by the delayed writeback I have implemented in the vfs branch.
Activity
animosity022 commentedon May 31, 2020
I am trying to make sure I'm following.
You copy a file to the mount.
It fails uploading because of something.
You remount and the file that was there is gone?
The error you had posted looks like a file was changed during upload.
Zvezdin commentedon May 31, 2020
You use chrome to download a file with a target destination somewhere in the mount.
It fails. You remount and it's gone.
animosity022 commentedon May 31, 2020
How does it fail though? When you a copy a file to the mount and the upload fails, it normally returns an IO write error on the mount.
I'd probably update the title as that's not silent file corruption either. It's a missing file on a failed upload if I'm understanding you.
Zvezdin commentedon May 31, 2020
The only way I understand that it fails is by seeing the log output of the mount process (https://termbin.com/g2o30). Chrome does not give out any errors and the file is perfectly readable and accessible in the mount directory, until it is remounted and disappears as it was never uploaded in the first place. What I tried to explain may not be "silent corruption". However it is still quite dangerous as the user does something very normal (download a file from the internet), the mount behaves as if the operation as successful (lists the file in the directory, allows the user to successfully read it), and eventually it turns out that the operation was unsuccessful. I don't know if/how Chrome handles IO errors when downloading files. However I suspect that there were no IO write errors given as the file wouldn't be placed in the mount in the first place.
animosity022 commentedon May 31, 2020
Without seeing a debug log, it's really a guessing game.
When you fail an upload, it gives an IO error on a mount as that's an easy test on a mount in Linux terminal.
Your issue is a duplicate of this one:
#2382
I'd surmise Chrome is hiding the IO error and losing files is always a bad thing.
I'd be more curious on fixing when you have some many upload failures? That in itself seems strange.
Zvezdin commentedon May 31, 2020
The observed behaviour really seems identical to #2382. However in the latter's description it is stated that this happens when "the VFS cache will begin deleting any non uploaded files when they reach their retries amount." What I observe here is that the operation is cancelled even before reaching the stated retries amount and the delay between retries. It may still be the same issue triggered by a different stimulus however.
I double checked the log I sent to @ncw and I think that it's safe to post here too, so here it is: https://termbin.com/93kb
I think think that rclone gets confused when chrome first creates an empty file, this empty file is uploaded to the backend, rclone comes back to check if the sizes are the same and by that time chrome has already filled up that local file with content, hence the uploaded file is rejected.
What is weird here is why rclone does not retry the same upload operation as given by the flags
--retries 99 --retries-sleep 10sncw commentedon Jun 2, 2020
Here is an edited annotated log of what happened
The error in question is this one
That is onedrive complaining that you are about to rename a file on top of an existing file.
Renaming a file on top of another file isn't part of the integration tests which means that rclone backends are differ in their implementations. The local backend will overwrite an existing file whereas the onedrive backend throws an error.
If the onedrive backend had allowed the rename in this case then it would have worked.
This would also have been fixed by the delayed writeback I have implemented in the vfs branch.
[-]Silent file corruption with rclone mount[/-][+]vfs: losing data when doing writeback[/+]gservat commentedon Jul 20, 2020
I just ran into this issue but using Google Drive. @ncw will the fix you put together also fix it for other backends like Google Drive?
ncw commentedon Jul 21, 2020
I hope this should be fixed in the latest beta if someone wants to try it.
10 remaining items
vfs: fix saving from chrome without --vfs-cache-mode writes #4293
vfs: fix saving from chrome without --vfs-cache-mode writes rclone#4293
vfs: fix saving from chrome without --vfs-cache-mode writes - fixes r…
vfs: check destination on rename and delete if it exists first FIXME …