How to create and use a Google Drive client ID

Having noticed advice on the forum, particularly from @Animosity022, to use your own client ID, I have followed the instructions here:

I have generated a client ID and client secret, and added them to the corresponding lines at the start of my rclone.conf file, in place of the # signs here:
type = drive
client_id = #################
client_secret = ##############

But when I run my rclone sync command, it runs for about a minute and exits. The log file shows repeated entries like this:

2019/04/16 13:53:29 DEBUG : gdrive: Loaded invalid token from config file - ignoring
2019/04/16 13:53:29 DEBUG : gdrive: Token refresh failed try 1/5: oauth2: cannot fetch token: 401 Unauthorized
Response: {
“error”: “unauthorized_client”,
“error_description”: “Unauthorized”

and finally an error:

2019/04/16 13:54:28 ERROR : : error reading destination directory: couldn’t list directory: Get blah, blah , blah… : oauth2: cannot fetch token: 401 Unauthorized
Response: {
“error”: “unauthorized_client”,
“error_description”: “Unauthorized”

I’d be very grateful for advice about what I’m doing wrong and how to fix it.

You need to run rclone config and add them that way as you missed doing the last step:

Thanks for the quick reply. I’ve run rclone config, and added the ID and secret to my existing remote, but I still get the same errors.

The rclone.conf file shows the client ID and the client secret, as I’ve entered them via the rclone config dialogue. The next line in rclone.conf is

token = {“access_token”:“ya29…blah,blah…”,“expiry”:“2019-04-14T21:47:18.761722421+01:00”}

which I think is the expired token that the log shows rclone trying, and failing, to refresh.

Any thoughts?

Or just run another authorize.

If you ran rclone config and entered in your information, it should have asked you to refresh the token to authorize it. Did you do that?


1 Like

Rats! Didn’t clock what that was about. Done now, and all working brilliantly, and lightning fast!

Many thanks for your great patience!


1 Like


Just making sure we didn’t miss something along the way and happy you got it fixed!

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