Repository navigation
Description
What is the problem you are having with rclone?
I have rclone_v1.47_x64 run on Ubuntu, i cannot delete files on GoogleDrive.
I use this command:
rclone -v delete GD:myfolder/myfile.json
i get theses messages:
2020/02/19 17:58:04 INFO : Waiting for deletions to finish
2020/02/19 17:58:05 ERROR : myfile.json: Couldn't delete: googleapi: Error 403: The user does not have sufficient permissions for this file., insufficientFilePermissions
2020/02/19 17:58:05 ERROR : Attempt 1/3 failed with 2 errors and: failed to delete 1 files
2020/02/19 17:58:05 INFO : Waiting for deletions to finish
2020/02/19 17:58:06 ERROR : myfile.json: Couldn't delete: googleapi: Error 403: The user does not have sufficient permissions for this file., insufficientFilePermissions
2020/02/19 17:58:06 ERROR : Attempt 2/3 failed with 2 errors and: failed to delete 1 files
2020/02/19 17:58:06 INFO : Waiting for deletions to finish
2020/02/19 17:58:07 ERROR : myfile.json: Couldn't delete: googleapi: Error 403: The user does not have sufficient permissions for this file., insufficientFilePermissions
2020/02/19 17:58:07 ERROR : Attempt 3/3 failed with 2 errors and: failed to delete 1 files
2020/02/19 17:58:07 Failed to delete: failed to delete 1 files
Please, help me?
Thank you.
What is your rclone version (output from rclone version)
rclone v1.47.0
- os/arch: linux/amd64
- go version: go1.12.4
Which OS you are using and how many bits (eg Windows 7, 64 bit)
Ubuntu 19.04 version 64bits
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 -v delete GD:myfolder/myfile.json
Activity
[-]delete-files-on-googledrive-with-rclone-command not works[/-][+]drive: can't delete shared files[/+]ncw commentedon Feb 24, 2020
I remembered the problem with shared files/folders.
Currently rclone tries to delete them if you ask for them to be deleted - seems reasonable... However this causes Drive to try to delete the original which you don't have permission for. See the docs here: https://developers.google.com/drive/api/v3/reference/files/delete
What rclone should be doing is unlinking the file from the directory I think, so PATCHing the parents of the file/folder so that the current directory is not in them, so using the removeParents parameter here: https://developers.google.com/drive/api/v3/reference/files/update
Possible fixes
rclone reads the
canDeleteflag in thecapabilitiesand if that is not set then use theremoveParentswork-around. ThecanDeleteflag needs to be added to the object I think so read in the listings etc,we attempt to delete it the normal way and if that fails with a 403 error attempt to delete it with the
removeParentsway.Option 2 is probably easiest to code however it will be a little less efficient if we are deleting lots of shared files.
Open Question: can we use the
removeParentsworkaround all the time - what happens if we orphan a file?Anyone like to work on this?
ivandeex commentedon Feb 9, 2021
@lebossejames
This bug is reported against an obsolete version of rclone. Can you reproduce it with rclone 1.54?
ezlo-eugenek commentedon Mar 3, 2021
I can confirm that it is still so in 1.54.
rclone version
rclone v1.54.0
rclone delete drive-:/test-shared/test.docx --drive-shared-with-me
2021/03/03 09:38:57 ERROR : test.docx: Couldn't delete: googleapi: Error 403: The user does not have sufficient permissions for this file., insufficientFilePermissions
2021/03/03 09:38:57 ERROR : Attempt 1/3 failed with 2 errors and: failed to delete 1 files
jonathantyar commentedon Dec 16, 2021
any PR or update regarding this issue?
zezettepglc commentedon Aug 7, 2023
This bug is still in 1.63.1 ...
With Grive, deleting files created by other Google account in a shared folder is not a problem
ncw commentedon Aug 9, 2023
I don't think this would be very difficult to fix - I outlined a plan above.
If you are working on behalf of a company you might be interested in taking out a support contract which can help you get answers quicker and keeps the rclone project sustainable. I could do this as part of a support contract.
adityabagla7 commentedon Sep 4, 2026
I'll take this. Plan: on delete/trash 403
insufficientFilePermissions, fall back to unlinking viaremoveParents(maintainer option 2 in the thread), with tests and a short docs note.drive: unlink shared files on delete permission errors - fixes rclone…