Google Drive OAuth Time Issues

What is the problem you are having with rclone?

I've been using Google Drive fine for a few months, but it suddenly stopped working around a week ago or so, failing as unauthorised. Logs show:

couldn't fetch token - maybe it has expired? - refresh with "rclone config reconnect ISVR-GDrive{qZrvJ}:": oauth2: cannot fetch token: 401 Unauthorized

Trying to run that command results in:

Error: config name contains invalid characters - may only contain `0-9`, `A-Z`, `a-z`, `_`, `-`, `.` and space

Getting rid of the "{qZrvJ}" bit at least sort of works, but then gives the error:

Error: backend doesn't support reconnect or authorize

If the above error is true, why does it tell me to do it in the first place.

Anyway, I manually re-authed by running the auth process on another machine, but the token's expiry date was the same day and thus rclone started working again, but stopped working again later the same day when the token expired.

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

- os/version: arch "rolling" (64 bit)
- os/kernel: 5.16.2-arch1-1 (x86_64)
- os/type: linux
- os/arch: amd64
- go/version: go1.18.1
- go/linking: dynamic
- go/tags: none

Which cloud storage system are you using? (eg Google Drive)

Google Drive connected to an Enterprise Business account.

The command you were trying to run (eg rclone copy /tmp remote:tmp)


#### The rclone config contents with secrets removed.  
```[ISVR-GDrive]
type = drive
client_id = <client was here>
client_secret = <client secret was here>
scope = drive
token = {token was here}
use_trash = true
chunk_size = 256Mi
acknowledge_abuse = true
team_drive =
root_folder_id =
stop_on_upload_limit = true
stop_on_download_limit = true
service_account_file =

A log from the command with the -vv flag

Obfuscated.

2022/05/02 19:27:12 DEBUG : rclone: Version "v1.58.1" starting with parameters ["rclone" "move" "-vv" "--progress" "--fast-list" "--drive-chunk-size" "256M" "--ignore-existing" "--drive-stop-on-upload-limit" "--drive-stop-on-download-limit" "ALargeFile" "ISVR-GDrive:/MyFolder/"]
2022/05/02 19:27:12 DEBUG : Creating backend with remote "ALargeFile"
2022/05/02 19:27:12 DEBUG : Using config file from "/root/.config/rclone/rclone.conf"
2022/05/02 19:27:12 DEBUG : fs cache: adding new entry for parent of "ALargeFile", "/my/local/folder"
2022/05/02 19:27:12 DEBUG : Creating backend with remote "ISVR-GDrive:/MyFolder/"
2022/05/02 19:27:12 DEBUG : ISVR-GDrive: detected overridden config - adding "{qZrvJ}" suffix to name
2022/05/02 19:27:12 DEBUG : ISVR-GDrive{qZrvJ}: Loaded invalid token from config file - ignoring
2022/05/02 19:27:12 DEBUG : ISVR-GDrive{qZrvJ}: Token refresh failed try 1/5: oauth2: cannot fetch token: 401 Unauthorized
Response: {
  "error": "unauthorized_client",
  "error_description": "Unauthorized"
}
2022/05/02 19:27:13 DEBUG : ISVR-GDrive{qZrvJ}: Loaded invalid token from config file - ignoring
2022/05/02 19:27:13 DEBUG : ISVR-GDrive{qZrvJ}: Token refresh failed try 2/5: oauth2: cannot fetch token: 401 Unauthorized
Response: {
  "error": "unauthorized_client",
  "error_description": "Unauthorized"
}
2022/05/02 19:27:14 DEBUG : ISVR-GDrive{qZrvJ}: Loaded invalid token from config file - ignoring
2022/05/02 19:27:14 DEBUG : ISVR-GDrive{qZrvJ}: Token refresh failed try 3/5: oauth2: cannot fetch token: 401 Unauthorized
Response: {
  "error": "unauthorized_client",
  "error_description": "Unauthorized"
}
2022/05/02 19:27:15 DEBUG : ISVR-GDrive{qZrvJ}: Loaded invalid token from config file - ignoring
2022/05/02 19:27:15 DEBUG : ISVR-GDrive{qZrvJ}: Token refresh failed try 4/5: oauth2: cannot fetch token: 401 Unauthorized
Response: {
  "error": "unauthorized_client",
  "error_description": "Unauthorized"
}
2022/05/02 19:27:16 DEBUG : ISVR-GDrive{qZrvJ}: Loaded invalid token from config file - ignoring
2022/05/02 19:27:16 DEBUG : ISVR-GDrive{qZrvJ}: Token refresh failed try 5/5: oauth2: cannot fetch token: 401 Unauthorized
Response: {
  "error": "unauthorized_client",
  "error_description": "Unauthorized"
}
2022/05/02 19:27:17 Failed to create file system for "ISVR-GDrive:/MyFolder/": couldn't find root directory ID: Get "https://www.googleapis.com/drive/v3/files/root?alt=json&fields=id&prettyPrint=false&supportsAllDrives=true": couldn't fetch token - maybe it has expired? - refresh with "rclone config reconnect ISVR-GDrive{qZrvJ}:": oauth2: cannot fetch token: 401 Unauthorized
Response: {
  "error": "unauthorized_client",
  "error_description": "Unauthorized"
}```


Additional: I tried setting up a service account using impostor which sort-of worked (mounting showed the wrong size until I told it to use an impostor) but trying to upload anything failed claiming it was over it's allowance. So I'm not using a service account at the moment as I cannot get it to work. Trying to follow any of the guides proved fruitless as they all seem slightly different, none of them match what I see on Google's side and it was basically a mess of confusion.

hi,

cannot be sure, as you did not post the command and debug output.

but to make a guess, the failed command was
rclone config reconnect ISVR-GDrive

and the correct command is
rclone config reconnect ISVR-GDrive:

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