Invalid refresh token

Hello,

i don' find any solution and any related topics are closed. Thats why i need to ask this question again:

My question:
Do i really need to reconnect my google drive one time per week??

Logfile:

2024/10/31 10:59:50 INFO  : vfs cache: cleaned: objects 1 (was 1) in use 0, to upload 0, uploading 0, total size 80.677Ki (was 80.677Ki)
2024/10/31 11:00:50 INFO  : vfs cache: cleaned: objects 1 (was 1) in use 0, to upload 0, uploading 0, total size 80.677Ki (was 80.677Ki)
2024/10/31 11:01:50 INFO  : vfs cache: cleaned: objects 1 (was 1) in use 0, to upload 0, uploading 0, total size 80.677Ki (was 80.677Ki)
2024/10/31 11:02:50 INFO  : vfs cache: cleaned: objects 1 (was 1) in use 0, to upload 0, uploading 0, total size 80.677Ki (was 80.677Ki)
2024/10/31 11:03:50 INFO  : vfs cache: cleaned: objects 1 (was 1) in use 0, to upload 0, uploading 0, total size 80.677Ki (was 80.677Ki)
2024/10/31 11:04:50 INFO  : vfs cache: cleaned: objects 1 (was 1) in use 0, to upload 0, uploading 0, total size 80.677Ki (was 80.677Ki)
2024/10/31 11:05:50 INFO  : vfs cache: cleaned: objects 1 (was 1) in use 0, to upload 0, uploading 0, total size 80.677Ki (was 80.677Ki)
2024/10/31 11:06:50 INFO  : vfs cache: cleaned: objects 1 (was 1) in use 0, to upload 0, uploading 0, total size 80.677Ki (was 80.677Ki)
2024/10/31 11:07:50 INFO  : vfs cache: cleaned: objects 1 (was 1) in use 0, to upload 0, uploading 0, total size 80.677Ki (was 80.677Ki)
2024/10/31 11:08:50 INFO  : vfs cache: cleaned: objects 1 (was 1) in use 0, to upload 0, uploading 0, total size 80.677Ki (was 80.677Ki)
2024/10/31 11:09:50 INFO  : vfs cache: cleaned: objects 1 (was 1) in use 0, to upload 0, uploading 0, total size 80.677Ki (was 80.677Ki)
2024/10/31 11:10:50 INFO  : vfs cache: cleaned: objects 1 (was 1) in use 0, to upload 0, uploading 0, total size 80.677Ki (was 80.677Ki)
2024/10/31 11:11:50 INFO  : vfs cache: cleaned: objects 1 (was 1) in use 0, to upload 0, uploading 0, total size 80.677Ki (was 80.677Ki)
2024/10/31 11:12:50 INFO  : vfs cache: cleaned: objects 1 (was 1) in use 0, to upload 0, uploading 0, total size 80.677Ki (was 80.677Ki)
2024/10/31 11:13:50 INFO  : vfs cache: cleaned: objects 1 (was 1) in use 0, to upload 0, uploading 0, total size 80.677Ki (was 80.677Ki)
2024/10/31 11:14:50 INFO  : vfs cache: cleaned: objects 1 (was 1) in use 0, to upload 0, uploading 0, total size 80.677Ki (was 80.677Ki)
2024/10/31 11:15:50 INFO  : vfs cache: cleaned: objects 1 (was 1) in use 0, to upload 0, uploading 0, total size 80.677Ki (was 80.677Ki)
2024/10/31 11:16:50 INFO  : vfs cache: cleaned: objects 1 (was 1) in use 0, to upload 0, uploading 0, total size 80.677Ki (was 80.677Ki)
2024/10/31 11:17:50 INFO  : vfs cache: cleaned: objects 1 (was 1) in use 0, to upload 0, uploading 0, total size 80.677Ki (was 80.677Ki)
2024/10/31 11:18:50 INFO  : vfs cache: cleaned: objects 1 (was 1) in use 0, to upload 0, uploading 0, total size 80.677Ki (was 80.677Ki)
2024/10/31 11:19:50 INFO  : vfs cache: cleaned: objects 1 (was 1) in use 0, to upload 0, uploading 0, total size 80.677Ki (was 80.677Ki)
2024/10/31 11:20:50 INFO  : vfs cache: cleaned: objects 1 (was 1) in use 0, to upload 0, uploading 0, total size 80.677Ki (was 80.677Ki)
2024/10/31 11:21:50 INFO  : vfs cache: cleaned: objects 1 (was 1) in use 0, to upload 0, uploading 0, total size 80.677Ki (was 80.677Ki)
2024/10/31 11:21:50 INFO  : Google drive root '': Change notify listener failure: Get "https://www.googleapis.com/drive/v3/changes?alt=json&fields=nextPageToken%2CnewStartPageToken%2Cchanges%28fileId%2Cfile%28name%2Cparents%2CmimeType%29%29&includeItemsFromAllDrives=true&pageSize=1000&pageToken=22952&prettyPrint=false&restrictToMyDrive=true&supportsAllDrives=true": couldn't fetch token: invalid_grant: maybe token expired? - try refreshing with "rclone config reconnect googledrive:"
2024/10/31 11:22:50 INFO  : vfs cache: cleaned: objects 1 (was 1) in use 0, to upload 0, uploading 0, total size 80.677Ki (was 80.677Ki)
2024/10/31 11:22:50 INFO  : Google drive root '': Failed to get StartPageToken: Get "https://www.googleapis.com/drive/v3/changes/startPageToken?alt=json&prettyPrint=false&supportsAllDrives=true": couldn't fetch token: invalid_grant: maybe token expired? - try refreshing with "rclone config reconnect googledrive:"
2024/10/31 11:23:15 ERROR : /: Dir.Stat error: couldn't list directory: Get "https://www.googleapis.com/drive/v3/files?alt=json&fields=files%28id%2Cname%2Csize%2Cmd5Checksum%2Csha1Checksum%2Csha256Checksum%2Ctrashed%2CexplicitlyTrashed%2CmodifiedTime%2CcreatedTime%2CmimeType%2Cparents%2CwebViewLink%2CshortcutDetails%2CexportLinks%2CresourceKey%29%2CnextPageToken%2CincompleteSearch&includeItemsFromAllDrives=true&pageSize=1000&prettyPrint=false&q=trashed%3Dfalse+and+%28%270APIMSdKmX0pxUk9PVA%27+in+parents%29&supportsAllDrives=true": couldn't fetch token: invalid_grant: maybe token expired? - try refreshing with "rclone config reconnect googledrive:"
2024/10/31 11:23:15 ERROR : IO error: couldn't list directory: Get "https://www.googleapis.com/drive/v3/files?alt=json&fields=files%28id%2Cname%2Csize%2Cmd5Checksum%2Csha1Checksum%2Csha256Checksum%2Ctrashed%2CexplicitlyTrashed%2CmodifiedTime%2CcreatedTime%2CmimeType%2Cparents%2CwebViewLink%2CshortcutDetails%2CexportLinks%2CresourceKey%29%2CnextPageToken%2CincompleteSearch&includeItemsFromAllDrives=true&pageSize=1000&prettyPrint=false&q=trashed%3Dfalse+and+%28%270APIMSdKmX0pxUk9PVA%27+in+parents%29&supportsAllDrives=true": couldn't fetch token: invalid_grant: maybe token expired? - try refreshing with "rclone config reconnect googledrive:"
2024/10/31 11:23:15 ERROR : /: Dir.Stat error: couldn't list directory: Get "https://www.googleapis.com/drive/v3/files?alt=json&fields=files%28id%2Cname%2Csize%2Cmd5Checksum%2Csha1Checksum%2Csha256Checksum%2Ctrashed%2CexplicitlyTrashed%2CmodifiedTime%2CcreatedTime%2CmimeType%2Cparents%2CwebViewLink%2CshortcutDetails%2CexportLinks%2CresourceKey%29%2CnextPageToken%2CincompleteSearch&includeItemsFromAllDrives=true&pageSize=1000&prettyPrint=false&q=trashed%3Dfalse+and+%28%270APIMSdKmX0pxUk9PVA%27+in+parents%29&supportsAllDrives=true": couldn't fetch token: invalid_grant: maybe token expired? - try refreshing with "rclone config reconnect googledrive:"
2024/10/31 11:23:15 ERROR : IO error: couldn't list directory: Get "https://www.googleapis.com/drive/v3/files?alt=json&fields=files%28id%2Cname%2Csize%2Cmd5Checksum%2Csha1Checksum%2Csha256Checksum%2Ctrashed%2CexplicitlyTrashed%2CmodifiedTime%2CcreatedTime%2CmimeType%2Cparents%2CwebViewLink%2CshortcutDetails%2CexportLinks%2CresourceKey%29%2CnextPageToken%2CincompleteSearch&includeItemsFromAllDrives=true&pageSize=1000&prettyPrint=false&q=trashed%3Dfalse+and+%28%270APIMSdKmX0pxUk9PVA%27+in+parents%29&supportsAllDrives=true": couldn't fetch token: invalid_grant: maybe token expired? - try refreshing with "rclone config reconnect googledrive:"
2024/10/31 11:23:45 ERROR : /: Dir.Stat error: couldn't list directory: Get "https://www.googleapis.com/drive/v3/files?alt=json&fields=files%28id%2Cname%2Csize%2Cmd5Checksum%2Csha1Checksum%2Csha256Checksum%2Ctrashed%2CexplicitlyTrashed%2CmodifiedTime%2CcreatedTime%2CmimeType%2Cparents%2CwebViewLink%2CshortcutDetails%2CexportLinks%2CresourceKey%29%2CnextPageToken%2CincompleteSearch&includeItemsFromAllDrives=true&pageSize=1000&prettyPrint=false&q=trashed%3Dfalse+and+%28%270APIMSdKmX0pxUk9PVA%27+in+parents%29&supportsAllDrives=true": couldn't fetch token: invalid_grant: maybe token expired? - try refreshing with "rclone config reconnect googledrive:"
2024/10/31 11:23:45 ERROR : IO error: couldn't list directory: Get "https://www.googleapis.com/drive/v3/files?alt=json&fields=files%28id%2Cname%2Csize%2Cmd5Checksum%2Csha1Checksum%2Csha256Checksum%2Ctrashed%2CexplicitlyTrashed%2CmodifiedTime%2CcreatedTime%2CmimeType%2Cparents%2CwebViewLink%2CshortcutDetails%2CexportLinks%2CresourceKey%29%2CnextPageToken%2CincompleteSearch&includeItemsFromAllDrives=true&pageSize=1000&prettyPrint=false&q=trashed%3Dfalse+and+%28%270APIMSdKmX0pxUk9PVA%27+in+parents%29&supportsAllDrives=true": couldn't fetch token: invalid_grant: maybe token expired? - try refreshing with "rclone config reconnect googledrive:"
2024/10/31 11:23:50 INFO  : vfs cache: cleaned: objects 1 (was 1) in use 0, to upload 0, uploading 0, total size 80.677Ki (was 80.677Ki)
2024/10/31 11:23:50 INFO  : Google drive root '': Failed to get StartPageToken: Get "https://www.googleapis.com/drive/v3/changes/startPageToken?alt=json&prettyPrint=false&supportsAllDrives=true": couldn't fetch token: invalid_grant: maybe token expired? - try refreshing with "rclone config reconnect googledrive:"

.....

rclone version:

2024/10/31 13:35:45 DEBUG : rclone: Version "v1.68.0" starting with parameters ["rclone" "-vvv" "version"]
rclone v1.68.0
- os/version: arch 24.1.1 (64 bit)
- os/kernel: 6.10.13-3-MANJARO (x86_64)
- os/type: linux
- os/arch: amd64
- go/version: go1.23.1
- go/linking: dynamic
- go/tags: none
2024/10/31 13:35:45 DEBUG : rclone: Version "v1.68.0" finishing with parameters ["rclone" "-vvv" "version"]

welcome to the forum,

no, there is something wrong with the current remote.
best to follow the rclone docs and create a new remote

i moved a few week ago from linux mint to manjaro linux but have the same issue.

i've just copied my .config/rclone/rclone.conf and nothing else:

[googledrive]
type = drive
client_id = ...
client_secret = ...
scope = drive
token = {"access_token":"...","token_type":"Bearer","refresh_token":"...","expiry":"..."}
team_drive = 

what would be the difference to create a new one?

not move, not copy.
create a new remote, follow the rclone docs exactly.

well, there is something wrong with the current remote.

i've deleted now my old config file and created a new one with "rclone config" like described here: Google drive

But i keep remote name, client_id and client_secret like before, thats why my new config is very similar to the old one. I hope that will fix my "refresh token" problem. I will report it in a week :slight_smile:

in case it does not work the problem might be with client_id settings. Then repeat all process again (creating remote from scratch) but using new client_id. It happens surprisingly often. Maybe rclone docs are not 100% clear? Just in case here simplified way to create client_id which worked for many people with similar issue:

i made already a new client_id after using the same rclone config and client_id on two different Linux distributions. but didn't help

I don't no what happend, but its invalid again:

2024/11/13 15:33:05 CRITICAL: Failed to create file system for "googledrive:": 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: invalid_grant: maybe token expired? - try refreshing with "rclone config reconnect googledrive:"

thats why i had to do again (i need to do this nearly every week):

rclone config reconnect googledrive:

there is something wrong in your setup. else the forum would be full of similar topics.

sorry, still not clear if you completely started over from scratch, not re-using anything from before?

  1. create new remote name
  2. create new client id+secret

How does your token look like? Below example of mine (working for many months and refreshing every time I use it - you can see I've just used it now):

[drive]
type = drive
client_id = ccc.apps.googleusercontent.com
client_secret = bbb
token = {"access_token":"xxx","token_type":"Bearer","refresh_token":"yyy","expiry":"2024-11-13T22:40:57.584464+01:00"}

Have you followed my guide? You definitely do some step(s) differently and end up with temporary token.

Do not try to fix it - it is more complex than re-doing it - delete everything (including your client_id) and start from zero.

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