I read over the other issue, but it's not clear what the actual solution is.
I checked my OAuth consent screen settings and it's set as "Production" publishing status and "External" user type already. I have never changed it so it has been that way since it was set up over 3 years ago.
I do see one difference in that I am using a GSuite account and my client ID is set as "Desktop" app type instead of "Other" as mentioned in the guide. There doesn't appear to be a way to change that.
Should I clear everything out and set up again from scratch?
More info. Sometimes it will fail to refresh within an hour or 2, but other times it seems to go all day without a failure. It seems like maybe when there is a lot of steady activity things work well, but if there is enough idle time is when the failure occurs.
In any case I created a new OAuth Client ID so we will see if that makes a difference.
When I try to access my Google drive after letting it sit idle rclone reports the following errors.
2021/02/16 17:22:11 ERROR : Google drive root '': Statfs failed: failed to get Drive storageQuota: Get "https://www.googleapis.com/drive/v3/about?alt=json&fields=storageQuota&prettyPrint=false": couldn't fetch token - maybe it has expired? - refresh with "rclone config reconnect MyNHWG:": context canceled
2021/02/16 17:22:16 ERROR : /: Dir.Stat error: couldn't list directory: Get "https://www.googleapis.com/drive/v3/files?alt=json&fields=files%28id%2Cname%2Csize%2Cmd5Checksum%2Ctrashed%2CexplicitlyTrashed%2CmodifiedTime%2CcreatedTime%2CmimeType%2Cparents%2CwebViewLink%2CshortcutDetails%2CexportLinks%29%2CnextPageToken%2CincompleteSearch&includeItemsFromAllDrives=true&pageSize=1000&prettyPrint=false&q=trashed%3Dfalse+and+%28%27root%27+in+parents%29&supportsAllDrives=true": couldn't fetch token - maybe it has expired? - refresh with "rclone config reconnect MyNHWG:": context canceled
2021/02/16 17:22:21 ERROR : /: Dir.Stat error: couldn't list directory: Get "https://www.googleapis.com/drive/v3/files?alt=json&fields=files%28id%2Cname%2Csize%2Cmd5Checksum%2Ctrashed%2CexplicitlyTrashed%2CmodifiedTime%2CcreatedTime%2CmimeType%2Cparents%2CwebViewLink%2CshortcutDetails%2CexportLinks%29%2CnextPageToken%2CincompleteSearch&includeItemsFromAllDrives=true&pageSize=1000&prettyPrint=false&q=trashed%3Dfalse+and+%28%27root%27+in+parents%29&supportsAllDrives=true": couldn't fetch token - maybe it has expired? - refresh with "rclone config reconnect MyNHWG:": context canceled
This will repeat once or twice, several times if I'm trying to jump to a local mount point, or using the "Explorer" in the web gui. Things come back after issuing a rclone reconnect command and going through the refresh process:
> rclone config reconnect MyDrive:/
Oddly all of the shared drives I have connected stay very stable.
Try commenting out client_id and client_secret in the config file to use rclone's default ones. Then do an rclone config reconnect and see if you get the same problem?
This will tell us whether it is a property of your client_id or not.
Is there anything unusual about your rclone activity? Might you be running multiple rclone's at the same time? Or have you copied the config file many times to other machines?
Since yesterday I happened to catch it just as it repeated the refresh failure and retry 5 times, but then it recovered and was able to refresh the token on the next minute.
I'm not doing anything differently than I have done for years. I use an rclone mount and mergerfs merging with local files into a single source that feeds Plex/Sonarr/Radarr. New files are pushed to Google Drive through a separate "rclone copy" so that I can apply the --bwlimit for uploads.
I did recently move everything from an old Ubuntu machine to a new Unraid machine and did copy over the rclone config. However, that had been running with no trouble for a few months before this issue started occurring.
Failed to sync: couldn't list directory: Get "<>": couldn't fetch token - maybe it has expired? - refresh with "rclone config reconnect ID:": oauth2: cannot fetch token: 400 Bad Request
Response: {
"error": "invalid_grant",
"error_description": "Bad Request"
}
Updating the token is impossible for me, it is a script that runs local backup of 90 team drives 1x per week, it is difficult to update 90 tokens .....
I contacted google support and they reported that the problem is that the tokens being generated by RClone have very short validity, I believe they are 0auth and now the google API uses 0auht2
Does anyone know how to make the token's validity get longer?
In the message you posted, you can see it uses oauth2
Tokens last one hour per Google's API as that's nothing to do with rclone. It doesn't sound like you got a very good response from them about the issue unfortunately as they gave you a run around.