Delete files on GoogleDrive with rclone command3

Hello,

I try with rclone_v1.61.1 , i cannot delete files on GoogleDrive (upload/download works fine).

I get theses traces:

rclone -v delete HomeRaspHostFiles:/UsersWantOvpn.txt
2023/01/28 14:24:13 ERROR : UsersWantOvpn.txt: Couldn't delete: googleapi: Error 403: The user does not have sufficient permissions for this file., insufficientFilePermissions
2023/01/28 14:24:13 ERROR : Attempt 1/3 failed with 2 errors and: failed to delete 1 files
2023/01/28 14:24:14 ERROR : UsersWantOvpn.txt: Couldn't delete: googleapi: Error 403: The user does not have sufficient permissions for this file., insufficientFilePermissions
2023/01/28 14:24:14 ERROR : Attempt 2/3 failed with 2 errors and: failed to delete 1 files
2023/01/28 14:24:15 ERROR : UsersWantOvpn.txt: Couldn't delete: googleapi: Error 403: The user does not have sufficient permissions for this file., insufficientFilePermissions
2023/01/28 14:24:15 ERROR : Attempt 3/3 failed with 2 errors and: failed to delete 1 files
2023/01/28 14:24:15 Failed to delete with 2 errors: last error was: failed to delete 1 files

I don't find what is the problem, i use a service account.

Thank you

hello,

please post the redacted config.

[HomeRaspHostFiles]
type = drive
scope = drive
root_folder_id = 14jiS537Kk2ACtcBuhTc0c5xGGUoElXHt
service_account_file = /home/james/Desktop/Scripts/service_account.json

Does your service account user have permission to delete these files?

I don't know how can you see the permission of service accound on my personnal Drive?

It won't have any permissions by default unless you share it with the service account.

Service accounts act like separate users.

What is the solution?

Give the service account user the correct permissions is the solution.

I'm not sure on the mechanics of this, I know people often share directories with the service account user and then use --drive-shared-with-me to access them with the service account. There may be better solutions though.

Service accounts don't work particularly well with normal google drive accounts - they work best with an enterprise account where you can delegate permissions to them.

If i choose a plan ?

Having a plan doesn't help.

I suggest you don't use service accounts with your personal drive. That will fix it.

How is the upload/download working then? If you didn't grant the SA permissions to that Drive, nothing should work.

Create/upload/download is different from deleting.

The permissions are:

Yep, but I was wondering how he could be uploading/downloading files if he didn't grant any kind of access to the SA on the Google Drive:

He did grant access if the OP did nothing, it wouldn't work.

Have you a solution please?

Don't use a service account with a personal drive as noted above.

So how can i get a lifetime api key (deprecated by Google) ?

There is no need, just create a non-SA google drive remote and rclone will refresh the token whenever necessary and save it back to the config file.

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