Can't transfer from server to Google Drive - token expired?

What is the problem you are having with rclone?

I've already setup rclone and got it working so I can transfer files from my server to my Google Drive paid account. I've got several Shared Drives setup on my Google Drive however I've only been using 2 for the past few months. When I tried to transfer files to one of the drives I haven't used in months I wasn't able to do so.

Do the tokens for shared drives expire after a certain amount of time when nothing has been transferred to that drive?

How long do the tokens last for?

Is there a way to make the tokens permanent?

For my problem just now, how do I renew the tokens for my shared drives so I can transfer files to them again?

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

rclone v1.54.0-beta.4890.2708a7569

  • os/arch: linux/amd64
  • go version: go1.15.3

No

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

Google Drive Business Account

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

rclone move ~/private/rtorrent/data/"zTransfersToGoogleDriveC" SharedDrive2:/"" -v --transfers=4 --stats=5s --drive-use-trash --delete-empty-src-dirs

The rclone config contents with secrets removed.

[SharedDrive2]
type = drive
client_id = 
client_secret = 
scope = drive
token = {
team_drive = 

A log from the command with the -vv flag

2022/02/20 21:19:54 INFO  :
Transferred:             0 / 0 Bytes, -, 0 Bytes/s, ETA -
Errors:                 1 (retrying may help)
Elapsed time:        17.7s

2022/02/20 21:19:54 DEBUG : 4 go routines active
2022/02/20 21:19:54 Failed to move: couldn't list directory: Get "https://www.googleapis.com/drive/v3/files?alt=json&corpora=drive&driveId=0AFJBo5eFoP1TUk9PVA&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%270AFJBo5eFoP1TUk9PVA%27+in+parents%29&supportsAllDrives=true": couldn't fetch token - maybe it has expired? - refresh with "rclone config reconnect SharedDrive2:": oauth2: cannot fetch token: 400 Bad Request
Response: {
  "error": "invalid_grant",
  "error_description": "Bad Request"
}

hello,
make sure to redact the config files,

as per the debug log, have you tried to run
rclone config reconnect SharedDrive2:

that version of rclone is years old and on top of that, a beta version.
best to update to v1.57.0

Thanks. I removed the secret from the config file like the forum instructions said. Was there something else I was supposed to remove?

I entered that command you said and it gave me a link to authorize rclone for access. But when I went to the link in my browser it said "This site can’t be reached. 127.0.0.1 refused to connect". The address bar icon says "your connection to the site is not secure."

remove the client id, remove the token, remove the team drive.

[SharedDrive2]
type = drive
client_id = 
client_secret = 
scope = drive
token = 
team_drive = 

make sure to update to v1.57.0?

I replaced the "rclone" file with the file from here:
https://beta.rclone.org/v1.58.0-beta.6000.dc7e3ea1e/rclone-v1.58.0-beta.6000.dc7e3ea1e-linux-amd64.zip

I ran this command again:
rclone config reconnect SharedDrive2:

And it says this:
-bash: /media/zdt/gravy/bin/rclone: Permission denied

best to use latest stable v1.57.0

Permission denied, that is a linux permission issue.

try sudo chmod +x /media/zdt/gravy/bin/rclone

Tried that and it says: sudo password for gravy:
I enter my SSH password then it says:

gravy is not in the sudoers file. This incident will be reported

that is not really a rclone question and i am not a linux expert.

perhaps, try sudo -i and type in the password for your username
then chmod +x /media/zdt/gravy/bin/rclone

perhaps, download the latest stable to your home dir.

Still not working. I'll ask elsewhere about my password problem.

But regarding my rclone problem if anybody knows the answer to these questions then please let me know:

Do the tokens for shared drives expire after a certain amount of time when nothing has been transferred to that drive?

How long do the tokens last for?

Is there a way to make the tokens permanent?

For my problem just now, how do I renew the tokens for my shared drives so I can transfer files to them again?

from what i have read in the forum, one hour.

no, tokens always expire.
can use a service account file, as per the rclone docs

imho, without root, should be able to download rclone to your home dir and run it there.

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