Google Drive setup issue with account having an existing OAuth2 token

What is the problem you are having with rclone?

Rclone will not finish the Google Drive Authorize section from my Win10 PC nor my Ubuntu 20.04 headless server. A previous server used rclone to back up to Google Drive and that server is gone and I'm trying to copy the backed up data to the new server.

I'm using a new client_id/client_secret but Google keeps trying Authorize to the existing OAuth2 token.

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

rclone v1.60.0-beta.6373.2f461f13e

  • os/version: Microsoft Windows 10 Pro 21H2 (64 bit)
  • os/kernel: 10.0.19044.1826 (x86_64)
  • os/type: windows
  • os/arch: amd64
  • go/version: go1.18.4
  • go/linking: static
  • go/tags: cmount

rclone v1.60.0-beta.6373.2f461f13e

  • os/version: ubuntu 22.04 (64 bit)
  • os/kernel: 5.15.0-41-generic (x86_64)
  • os/type: linux
  • os/arch: amd64
  • go/version: go1.18.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 config

The rclone config contents with secrets removed.

type = drive
scope = drive
client_id = 199*
client_secret = G*

A log from the command with the -vv flag

rclone config doesn't seem to support the -vv flag so I ran this instead

rclone ls google-drive -vv
2022/07/25 21:01:50 DEBUG : rclone: Version "v1.60.0-beta.6373.2f461f13e" starting with parameters ["rclone" "ls" "google-drive" "-vv"]
2022/07/25 21:01:50 DEBUG : Creating backend with remote "google-drive"
2022/07/25 21:01:50 DEBUG : Using config file from "C:\\Users\\Daubsy\\AppData\\Roaming\\rclone\\rclone.conf"
2022/07/25 21:01:50 DEBUG : fs cache: renaming cache item "google-drive" to be canonical "//?/E:/temp/Temp/rclone-beta-latest-windows-amd64/rclone-v1.60.0-beta.6373.2f461f13e-windows-amd64/google-drive"
2022/07/25 21:01:50 ERROR : : error listing: directory not found
2022/07/25 21:01:50 DEBUG : 2 go routines active
2022/07/25 21:01:50 Failed to ls with 2 errors: last error was: directory not found

When the Win10 PC tries to connect to the Google API and authorize it, is shows these screens:

I'd trying clearing browser cache.

How does the log look on the Windows 10 PC when you try to authenticate? What's the debug output? What command did you run to get that window?

I deleted the current setup this morning as it wasn't working anyway and started a new connection. I also cleared the cache in Chrome. I've added a lot of pictures to this post too.

I started with the command

rclone config -vv --log-file=mylogfile.txt

Paste Bin link to detailed logs

It opened this page in Chrome. I highlighted the HA_Calendar bit for a reason. I think that might be part of the issue.

Image 045

The next two screens are the same as I uploaded in the previous post:

The next pic is from my Credentials page in the Google Console:

Note that I have a "rClone App" client id which I used for the Client Id/secret in the rClone config, but Google asked me to verify the HA_Calendar id. (Home Assistant Calendar in case anyone cared.)

Before anyone asks, I've already tried to use the HA_Calendar client id/secret, which also failed. Since the types of the two ids aren't the same (rclone is desktop and HA_Cal is TV/Limited), it isn't working either.

I'm not sure, but I think that either rClone or Google is not matching the client ids correctly. I hope that the detailed log link above helps determine that.

The Client ID/Secret are just for access to the API.

It doesn't matter what it's called on the admin console.

When you connect, you should get whatever account you want to login with as for example, this is my personal account:


and it looks like that.

The name of the app doesn't matter, but the type of app does.

TV Apps give you:


If you use a desktop app:


You'd see something like that.

When you connect, you should get whatever account you want to login with as for example, this is my personal account

When rClone tries to authenticate, I'm not getting the option to choose an account. The only one that is listed is "HA_Calendar," which is a TV app.

When I use the HA_Calendar client id/secret, I see the Error 400: invalid request screen like you are showing. When I use the rClone_id client id/secret, I see the HA_Calendar account to log into, which fails with the "Something went wrong" message.

I'm unsure if rClone is getting the first credentials from Google and showing that account instead of matching the client ids or if Google is sending the wrong account. I've seen the first at work with encryption tools that assumed they were the only installed product on the PC and would fail to decrypt data when they were the 2nd or 3rd tool installed due to mismatched keys/ids. Of course, user error (aka the dumb person typing this message right now) is a valid option too.

In the box you shared, if you don't want to use that account, you'd pick another account per the box below:

Use another account and sign in with whatever account you need:

That's from your screenshot above.

Choosing "Use another account" asks me to log into Google as a different person. If I wanted to log in as "John Smith" instead of as "Steve," I would do that there. Everything that I'm seeing is that rClone's client id is not matching up to my OAuth2 token, but I don't know why or what to do about it.

For oAuth to work, you need to login.
For the client ID to work, you need to not pick a TV app and use a Desktop app as I shared screenshots of each with the error when I use a TV app instead.

So you'd have to share some screenshots of what you've done and what isn't working based on the feedback I've shared.

I was reading your response, and I was getting frustrated (at myself mostly) because I had done all of that, and it wasn't working. So I was going to try one more time again. So I closed all of my browsers except for an incognito one and had rclone re-authorize.
It got me to a Success page, which was the first time I had seen it.

After trying to do a simple "ls" against the google-drive, it failed until I realized that I didn't type my google drive name properly. Once I fixed that, it started to list the folders exactly how I wanted them to. I'm not sure if using the Incognito browser fixed it or if I had some extension interfering, but it is working now, so thank you for the help.

1 Like

Perfect! Happy you got it working as that one is a bear at times as I've hit that one before as well!

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