Google Drive token keeps expiring, how to publish my app?

What is the problem you are having with rclone?

I've set up a Windows .bat script to run a backup of a particular directory every day. It consistently works for some time (a day, several days, a week... seems inconsistent) and then stops. If I refresh the token, then it runs again, until it doesn't again. I've seen loads of posts about this issue and have tried every suggestion I can, but many of them assume things will happen, that don't for me (or options available in Google, that appear not to be for me). I can't figure out how to "Publish" my app... it's already set as Internal, and I had thought that was all I needed to do. Not even sure it's relevant at all. Finally caving in and asking for help here.

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

- os/version: Microsoft Windows 10 Home 21H1 (64 bit)
- os/kernel: 10.0.19043.1645 (x86_64)
- os/type: windows
- os/arch: amd64
- go/version: go1.17.8
- go/linking: dynamic
- go/tags: cmount

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

Google Drive

set datepath=20%DATE:~10,4%%DATE:~4,2%%DATE:~7,2%
set y=%DATE:~10,4%
set m=%DATE:~4,2%
rclone copy V:\SC_Data_Files SCBackups:20%y%/%m%/%datepath%.SC_Data_Files --exclude *.scid --exclude *.dly --exclude *.depth

The rclone config contents with secrets removed.

--------------------
[SCBackups]
type = drive
client_id = 28566658206-f25ch9dt206hh053g99qtl99vtvbrplf.apps.googleusercontent.com
client_secret = xxxxxxxxxxxxxxxxxxxx
scope = drive
root_folder_id = 1O29XzSo5AaQwG6zGfchMZAGifmRg_-RP
token = {"access_token":"xxxxxxxxxxxxxx","token_type":"Bearer","expiry":"2022-04-15T14:12:03.6152955-07:00"}
team_drive =
--------------------

A log from the command with the -vv flag

I hope this is what's being asked for...

2022/04/18 13:22:04 DEBUG : rclone: Version "v1.58.0" starting with parameters ["rclone" "config" "-vv"]
2022/04/18 13:22:04 DEBUG : Using config file from "C:\\Users\\j\\AppData\\Roaming\\rclone\\rclone.conf"

hello and welcome to the forum,

are you a GSuite user?
(PS: if you are a GSuite user, you could also select "Internal" instead of "External" above, but this has not been tested/documented so far).

if not, as i understand it, need need to make the app external, that is what i do.

If you already configured an "Oauth Consent Screen", then skip to the next step; if not, click on "CONFIGURE CONSENT SCREEN" button (near the top right corner of the right panel), then select "External" 

Ah yes I am a GSuite (now Workspace) user. I've done the OAuth consent thing a zillion times but what the heck I'll try again... thanks!

So, apparently as I am a Workspace user, I can't publish an app. And it's already Internal so... now what?

If I log into console as a non-workspace user, then I get the option to publish, but not in my actual account.

perhaps @Animosity022 knows

1 Like

I'm confused as I don't get how you'd see a console if you aren't logged in that Google Admin account?

If you an internal app and configure the oauth, it's pretty straight forward as that's all I ever did for GSuite.

I don't use Google anymore so I can't check anything.

Yeah I don't know either. I'm logged into the cloud console, as my normal GSuite admin user. I'm the sole owner/user on the account. I have all the normal console stuff in there, but no way to "publish" the app that I can see. It's been driving me crazy for weeks (since I started using RClone).

I've never seen that before. I could only ever hit my GSuite account Google Admin as my GSuite Admin user.

Is something like the wrong project is picked or something along those lines? I'd write a support ticket if something isn't working right.

But I AM the GSuite Admin user. That's exactly how I'm accessing the console.

I have only this one project, never made any other.

I'm not saying I don't believe, but you either are wrong or you found a bug. I'm assuming the latter so I'd suggest asking support to give a hand.

1 Like

Yeah I want to believe I'm just making a mistake somehow, but I've been over this again and again and I just can't see anything. I'm absolutely logged in as my admin user, I have ALL the expected admin accesses and controls so... I dunno.

Are you suggesting I contact RClone support? Or Google? Cuz I've never had good luck contacting Google for support of any kind lol

Google support if you are missing a button that should be there. Nothing on the recline side can fix that.

1 Like

Looks like there is no support beyond billing, unless I purchase a support package. Yay.

So on a lark, I made the project External rather than Internal, which immediately presented me the Publish button. I've now published my app, so let's see if the token sticks around or not. I thought if it was Internal, then I didn't have to worry about it since I'm the only user but... maybe not.

Nope, didn't work. Token expired. This is maddening.

I attempted to set up a "use a service account file" as suggested to another user with seemingly the same issue. I followed all of Google's instructions and everything seemed to work, but I can't tell if it did anything.

Just now I manually refreshed the token, and ran the job again. The token literally expired during the job, about 3-4 minutes after starting it. I was running it at a command prompt so I watched it happen.

token expired and there's no refresh token - manually refresh with "rclone config reconnect SCBackups:"

I'm getting close to giving up on RClone and I really don't want to. Does anyone have any further suggestions on how I can get the token to stick around, or automatically refresh itself?

If you are using a service account, there aren't any tokens to refresh so something isn't right in your setup. Without seeing a rclone.conf and screenshots, it's hard to tell.

You don't seem to be having a rclone issue as it's more a Google issue and something specific to your account (bug/something) or a process that isn't quite right.

I have a test app on my personal Google account that is external in production:

Expiry on tokens usually 30 days out:

image

and I just tested it and refreshed no problem.

image

If there was a rclone issue with the way tokens were being refreshed, the forums would be flooded with it as Google Drive is very popular and used quite a bit.

So either it's a process issue which I'm not sure what or you have a Google bug.

Yeah I'm entirely willing to acknowledge that this could be something on my side, but I have no idea what... it's why I finally broke down and posted to get help here.

I've tried my app as external and in production, no change.

Also to be clear, I can manually refresh without any issue, every time. The problem is it won't remember the token for any length of time (though expiring after only a few minutes last night, was a first!)

I'm totally new to RClone so I don't know what to even show, but if you tell me what specifically to show and how to get it, I'll gladly post anything that might help. I appreciate your continued efforts to help out. :pray:

hello, I have the same problem, the token expires in a very short time and I have the app published. did you find any solution in the end?

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