🤔 Why does GDrive token always expire after 7 days?

What is the problem you are having with rclone?

Every 7 days when I run my rclone copy command, I get the CRITICAL error that appears below. The result is that the copy fails.

Why?

$ rclone copy gdrive: "BACKUP_DIR" \
	--update \
	--transfers 16 \
	--delete-excluded \
	--create-empty-src-dirs

2025/04/03 03:00:02 CRITICAL: Failed to create file system for "gdrive:": 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 gdrive:"

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

$ rclone version
rclone v1.69.0
- os/version: ubuntu 22.04 (64 bit)
- os/kernel: 6.8.0-57-generic (x86_64)
- os/type: linux
- os/arch: amd64
- go/version: go1.23.4
- 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 copy gdrive: "BACKUP_DIR" \
	--update \
	--transfers 16 \
	--delete-excluded \
	--create-empty-src-dirs

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

$ rclone config redacted
[gdrive]
type = drive
client_id = XXX
client_secret = XXX
scope = drive
token = XXX
team_drive = 
### Double check the config for sensitive info before posting publicly

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

Oh, crud!

I followed the instructions from the error message to run rclone config reconnect gdrive:, so it will take another 7 days before I can get the error output!

Could you accept my informatin now without that log?

I will likely have to return after 7 days to attach it.

Paste  log here

welcome to the forum,

if you follow the instruction in rclone docs, then that should not occur.
it is a common issue, much discussed in the forum.

Thank you for your reply.

Could you share a link the the section of the rclone documentation that resolves this, please? :hugs:

when you created the client id+secret, for your project, did you select "External" ?

Hmmm.... Thanks.

Perhaps I should just redo this from scratch.
There is a possibility that I might have mixed something up with so many steps.

I'll respond here when I am done. :hugs:

search for other threads on this forum about expired gdrive token. Seems some people make the same mistake.

If done properly nothing expires.