Rclone cleanup failed with insufficent permissions

What is the problem you are having with rclone?

rclone cleanup fails with insufficient permissions.. is it due to scope=drive.appfolder ?

Run the command 'rclone version' and share the full output of the command.

rclone v1.64.0
- os/version: ubuntu 22.04 (64 bit)
- os/kernel: 6.2.0-34-generic (x86_64)
- os/type: linux
- os/arch: amd64
- go/version: go1.21.1
- go/linking: static
- go/tags: none

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 cleanup google2:

Please run 'rclone config redacted' and share the full output. If you get command not found, please make sure to update rclone.

[google2]
type = drive
client_id = XXX
client_secret = XXX
scope = drive.appfolder
root_folder_id = XXX
token = XXX
team_drive =

A log from the command that you were trying to run with the -vv flag

$ rclone cleanup google2: -vv
2023/10/07 21:44:50 DEBUG : rclone: Version "v1.64.0" starting with parameters ["rclone" "cleanup" "google2:" "-vv"]
2023/10/07 21:44:50 DEBUG : Creating backend with remote "google2:"
2023/10/07 21:44:50 DEBUG : Using config file from "/home/user/.config/rclone/rclone.conf"
2023/10/07 21:44:50 ERROR : Attempt 1/3 failed with 1 errors and: googleapi: Error 403: Request had insufficient authentication scopes.
Details:
[
  {
    "@type": "type.googleapis.com/google.rpc.ErrorInfo",
    "domain": "googleapis.com",
    "metadata": {
      "method": "google.apps.drive.v3.DriveFiles.EmptyTrash",
      "service": "drive.googleapis.com"
    },
    "reason": "ACCESS_TOKEN_SCOPE_INSUFFICIENT"
  }
]

More details:
Reason: insufficientPermissions, Message: Insufficient Permission
2023/10/07 21:44:50 ERROR : Attempt 2/3 failed with 1 errors and: googleapi: Error 403: Request had insufficient authentication scopes.
Details:
[
  {
    "@type": "type.googleapis.com/google.rpc.ErrorInfo",
    "domain": "googleapis.com",
    "metadata": {
      "method": "google.apps.drive.v3.DriveFiles.EmptyTrash",
      "service": "drive.googleapis.com"
    },
    "reason": "ACCESS_TOKEN_SCOPE_INSUFFICIENT"
  }
]

More details:
Reason: insufficientPermissions, Message: Insufficient Permission
2023/10/07 21:44:50 ERROR : Attempt 3/3 failed with 1 errors and: googleapi: Error 403: Request had insufficient authentication scopes.
Details:
[
  {
    "@type": "type.googleapis.com/google.rpc.ErrorInfo",
    "domain": "googleapis.com",
    "metadata": {
      "method": "google.apps.drive.v3.DriveFiles.EmptyTrash",
      "service": "drive.googleapis.com"
    },
    "reason": "ACCESS_TOKEN_SCOPE_INSUFFICIENT"
  }
]

More details:
Reason: insufficientPermissions, Message: Insufficient Permission
2023/10/07 21:44:50 DEBUG : 6 go routines active
2023/10/07 21:44:50 Failed to cleanup: googleapi: Error 403: Request had insufficient authentication scopes.
Details:
[
  {
    "@type": "type.googleapis.com/google.rpc.ErrorInfo",
    "domain": "googleapis.com",
    "metadata": {
      "method": "google.apps.drive.v3.DriveFiles.EmptyTrash",
      "service": "drive.googleapis.com"
    },
    "reason": "ACCESS_TOKEN_SCOPE_INSUFFICIENT"
  }
]

More details:
Reason: insufficientPermissions, Message: Insufficient Permission

Could you create new remote (google_test) not providing client_id/secret and try cleanup again? It will validate whether issue is with your client_id or not.

do you mean something like

[google_test]
type = drive
client_id = 
client_secret = 
scope = drive.appfolder
root_folder_id = XXX
token = XXX
team_drive =

?

yes..

run rclone config and create new drive remote but do not provide your client_id/secret. Rclone will use its own default one.

If your scope is only appfolder, you can't empty the trash.

If thats the case then will the drive clean up itself for the items in the the trash? or how would you empty trash ?

Log in the WebUI - Click Empty Trash
Create a remote scoped to the drive so it has permission to the trash

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