Insuffient Perms to Delete Files in Gdrive My drive

What is the problem you are having with rclone?

rm -r of a directory shows input/ourput error.

The Oauth used here worked when I tried to delete something that was in a Team Drive of mine. But not when working with this encrypted one, with its base in the personal drives.

What is your rclone version (output from rclone version)

1.56.0

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)

rm -r /a/mounted/directory/trash
rclone mount drive: /home/location \
--config /home/blah.conf \
--allow-other \
--umask 002 \
--dir-cache-time 5000h \
--poll-interval 10s \
--vfs-cache-mode writes \
--vfs-cache-max-size 10G \
--vfs-cache-max-age 24h \
--vfs-cache-poll-interval 10s \
--vfs-read-ahead 2G \
--transfers 10

The rclone config contents with secrets removed.

[crypt1]
type = drive
scope = drive
client_id = xxx
client_secret = xxx
token = xxx
root_folder_id = xxx

[drive]
type = crypt
remote = crypt1:1/
scope = drive # I tried to remove this and didn't work either
password = xxx
password2 = xxx

A log from the command with the -vv flag

Dir.Remove failed to remove directory: googleapi: Error 403: The user does not have sufficient permissions for this file., insufficientFilePermissions

hi,

seems that the client_id does not have sufficient permissions for that personal drive.

please post a full debug log.

2021/09/16 17:16:40 DEBUG : Files/: Lookup: name="abandon2"
2021/09/16 17:16:40 DEBUG : Files/: >Lookup: node=Files/abandon2/, err=<nil>
2021/09/16 17:16:40 DEBUG : Files/abandon2/: Attr: 
2021/09/16 17:16:40 DEBUG : Files/abandon2/: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=<nil>
2021/09/16 17:16:42 DEBUG : Google drive root '1': Checking for changes on remote
2021/09/16 17:16:42 INFO  : vfs cache: cleaned: objects 0 (was 0) in use 0, to upload 0, uploading 0, total size 0 (was 0)
2021/09/16 17:16:42 DEBUG : Files/: Attr: 
2021/09/16 17:16:42 DEBUG : Files/: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=<nil>
2021/09/16 17:16:42 DEBUG : Files/: ReadDirAll: 
2021/09/16 17:16:42 DEBUG : Files/: >ReadDirAll: item=5, err=<nil>
2021/09/16 17:16:42 DEBUG : /: Attr: 
2021/09/16 17:16:42 DEBUG : /: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=<nil>
2021/09/16 17:16:42 DEBUG : /: Lookup: name="Files"
2021/09/16 17:16:42 DEBUG : /: >Lookup: node=Files/, err=<nil>
2021/09/16 17:16:42 DEBUG : Files/: Attr: 
2021/09/16 17:16:42 DEBUG : Files/: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=<nil>
2021/09/16 17:16:42 DEBUG : Files/: Lookup: name="abandon2"
2021/09/16 17:16:42 DEBUG : Files/: >Lookup: node=Files/abandon2/, err=<nil>
2021/09/16 17:16:42 DEBUG : Files/abandon2/: Attr: 
2021/09/16 17:16:42 DEBUG : Files/abandon2/: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=<nil>
2021/09/16 17:16:43 DEBUG : Files/abandon2/: ReadDirAll: 
2021/09/16 17:16:43 DEBUG : Files/abandon2/: >ReadDirAll: item=2, err=<nil>
2021/09/16 17:16:43 DEBUG : Files/abandon2/: Attr: 
2021/09/16 17:16:43 DEBUG : Files/abandon2/: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=<nil>
2021/09/16 17:16:43 DEBUG : Files/: Remove: name="abandon2"
2021/09/16 17:16:44 ERROR : Files/abandon2/: Dir.Remove failed to remove directory: googleapi: Error 403: The user does not have sufficient permissions for this file., insufficientFilePermissions
2021/09/16 17:16:44 DEBUG : Files/: >Remove: err=googleapi: Error 403: The user does not have sufficient permissions for this file., insufficientFilePermissions

might be easier to debug using rclone delete, not rclone mount
and to try to delete a file in crypt1

rclone -vv delete drive:Files/abandon2
2021/09/16 17:32:23 DEBUG : rclone: Version "v1.56.0" starting with parameters ["rclone" "-vv" "delete" "drive:Files/abandon2"]
2021/09/16 17:32:23 DEBUG : Creating backend with remote "drive:Files/abandon2"
2021/09/16 17:32:23 DEBUG : Using config file from "/home/user/.config/rclone/rclone.conf"
2021/09/16 17:32:23 DEBUG : Creating backend with remote "crypt1:1/ant0d3l284r5o9a0rop7d9rgmc/85fe927eu3sheod8nu0eolknn8"
2021/09/16 17:32:25 DEBUG : Waiting for deletions to finish
2021/09/16 17:32:25 DEBUG : 4 go routines active

But the folder is still there.
I added the access token with the google page full write read delete files access.
This might have something to do with my drive set up since it is inside my drive.

UPDATE: if I make a file myself I can delete it.

based on the docs, and some quick testing
rclone delete will not delete that root folder.

"rclone delete only deletes files but leaves the directory structure alone. If you want to delete a directory and all of its contents use the purge command."

$ rclone -vv purge drive:Filestesting1
2021/09/16 17:47:10 DEBUG : rclone: Version "v1.56.0" starting with parameters ["rclone" "-vv" "purge" "drive:Files/testing1"]
2021/09/16 17:47:10 DEBUG : Creating backend with remote "drive:Files/testing1"
2021/09/16 17:47:10 DEBUG : Using config file from "/home/user/.config/rclone/rclone.conf"
2021/09/16 17:47:10 DEBUG : Creating backend with remote "crypt1:1/ant0d3l284r5o9a0rop7d9rgmc/j8dgfolrtklu4fi22uogt4qdeo"
2021/09/16 17:47:13 ERROR : Attempt 1/3 failed with 1 errors and: googleapi: Error 403: The user does not have sufficient permissions for this file., insufficientFilePermissions
2021/09/16 17:47:13 ERROR : Attempt 2/3 failed with 1 errors and: googleapi: Error 403: The user does not have sufficient permissions for this file., insufficientFilePermissions
2021/09/16 17:47:13 ERROR : Attempt 3/3 failed with 1 errors and: googleapi: Error 403: The user does not have sufficient permissions for this file., insufficientFilePermissions
2021/09/16 17:47:13 DEBUG : 4 go routines active
2021/09/16 17:47:13 Failed to purge: googleapi: Error 403: The user does not have sufficient permissions for this file., insufficientFilePermissions

as before, seems that the clientid lacks the needed permissions for the rclone command.

So the files I can't delete is created by a service account
And I think that is where the problem is
I am not its owner

ok, not sure what rclone can do about that...

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