Google Drive Token expires after an hour

What is the problem you are having with rclone?

"""
My Google Gdrive Mounted cannot be accesssed after one hour. because the token expired. Even I refresh it but now ttoken still expires after 1 hour. I followed the offical setting to production, but it doesn't work. Now, the publishing status of my google app already are In production. Please help, I have been tortured for one month.
"""

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

"""
rclone v1.61.1

  • os/version: unknown
  • os/kernel: 3.10.108 (x86_64)
  • os/type: linux
  • os/arch: amd64
  • go/version: go1.19.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)

Paste command here

The rclone config contents with secrets removed.

Paste config here

A log from the command with the -vv flag

Paste  log here

Use the available template while posting to provide the commands and logs.

This is usually the problem - not set to production.

Are you sure you are actually using the right client_id? Double check the config file against the google console and then run rclone config reconnect name_of_your_remote:

Hi, Ncw,

Thank you for the reply. I double check the Cliend_id & secret again & make sure the input same with the Google console.
Then I run rclone config reconnect... it works for 1 hour again. Then.;...droped.

Shoule I paste the config here?

Can you post a screenshot (redact stuff if necessary) of the google console where you set up the ID, and your config file with secrets redacted - thanks.

HI, ncw, Thank you.

Editing existing "gdplex" remote with options:

Option client_id.
Google Application Client Id
Setting your own is recommended.
See Google drive for how to create your own.
If you leave this blank, it will use an internal key which is low performance.
Enter a string value. Press Enter for the default (104410819798-b8b3f0pdnfn5gubp2a1supj5khjam9tt.apps.googleusercontent.com).
client_id>

Your rclone setup looks fine.

It must be the setup of your client_id.

What does the oauth consent screen look like. It should look something like this

Yes. I didn't verify it as I only setup the app for my own use & I don't know to move it forward.
I follow the steps as the guideline: Google drive (rclone.org)
But when going to the

  1. Click "OAuth consent screen", then click "PUBLISH APP" button and confirm, or add your account under "Test users".

I cannot find where to add my account under "Test users".. can you help to find it out?

Thank you very much.

I find out how to add testing user. Let me try it again. Thank you.

H, ncw, I tried everything again, include adding the testing user, adding the domain. but nothing change.
Even, google don't request me to verify the app. I re-do the procedure again, cannot find any wrong steps.

So bad...

You don't have to verify the app if you are going to use it for yourself. The Oauth API has a sufficient limit for Google drive calls.

Hi, Yolobnb.,

I cannot find where to verify the app, only show "verification not required". There is not clear explanation in Google document. I don't know why. well, so frastrated.

As pointed out, you don't have to have the app verified for the config to work without problems.

Let's assume that the config is OK because it surely looks OK, and investigate elsewhere.

When rclone runs it needs to re-write the config file to save the updated tokens. Does the rclone that you use to run your mount have permission to write to the config file?

Hi, Ncw,
May you help to check if I used the correct Mount flags as following, Thank you very much.

rclone mount gdplex:/ /volume1/GDrive/O.plex --allow-other --attr-timeout 5m --vfs-cache-mode full --vfs-cache-max-age 24h --vfs-cache-max-size 10G --vfs-read-chunk-size-limit 100M --buffer-size 100M --daemon --allow-non-empty

Thank you. I tried to find out the problems.

hi,
would not use these, unless 100% sure it is needed for your case.
--allow-non-empty
--attr-timeout 5m
--vfs-read-chunk-size-limit
--buffer-size

and add --drive-pacer-min-sleep 10ms --drive-pacer-burst 200

rclone mount gdplex: /volume1/GDrive/O.plex --drive-pacer-min-sleep 10ms -drive-pacer-burst 200 --allow-other --vfs-cache-mode full --vfs-cache-max-age 24h --vfs-cache-max-size 10G --daemon

hi,asdffdsa,

Thank you for the suggestion. I used your suggested flags to tried it again. Still expiring in 1 hour. Any flags should I change? Pls help to check.

rclone mount gdplex:/ /volume1/GDrive/O.plex **--**drive-pacer-min-sleep 10ms --drive-pacer-burst 200 --allow-other --vfs-cache-mode full --vfs-cache-max-age 24h --vfs-cache-max-size 10G --daemon

rclone mount gdplex:/ /volume1/GDrive/O.plex --drive-pacer-min-sleep 10ms --drive-pacer-burst 200 --allow-other --vfs-cache-mode full --vfs-cache-max-age 24h --vfs-cache-max-size 10G --daemon

Should I add the flag: ```
--b2-download-auth-duration Duration

Hi Xiao,

Did you check this:

The user starting the mount must have write access to the config file and the folder containing it. This is needed to store the refreshed token. You can find the file location with rclone config file

If this doesn't help then I suggest you try this simple test sequence with the user your a using to start your mount:

rclone config reconnect name_of_your_remote:
rclone config show name_of_your_remote:
rclone lsd name_of_your_remote: -vv
# Wait in minimum 1 hour
rclone lsd name_of_your_remote: -vv

and then please post the redacted terminal output. Folders may be obscured, tokens should be obscured.

Important: Stop the mount before starting the test and keep it stopped until the test is completed.

No it is for Backblaze B2, not Google Drive.

pretty sure, this is not a flag issue, perhaps not a rclone issue.

fwiw, i would start over, create a new client_id, create a new gdrive remote using that new client_id